[3/5] d3dx9: Implement D3DXSaveSurfaceToFileW.

Józef Kucia joseph.kucia at gmail.com
Thu May 3 08:48:08 CDT 2012

Thanks for the review.

On Thu, May 3, 2012 at 1:08 PM, Henri Verbeet <hverbeet at gmail.com> wrote:
>> +    memcpy(&wic_pixel_format, pixel_format_guid, sizeof(GUID));
>> +    hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &wic_pixel_format);
>> +    d3d_pixel_format = wic_guid_to_d3dformat(&wic_pixel_format);
> What is all this for?

If a WIC bitmap encoder doesn't support a given pixel format, it
returns the closest supported pixel format.

> Also, how do you intend to implement D3DXSaveSurfaceToFileInMemory()?

It can be implemented by renaming D3DXSaveSurfaceToFileW() to
D3DXSaveSurfaceToFileInMemory(), and making it to use IStream which
uses the memory storage. Then, D3DXSaveSurfaceToFileW() will just call
D3DXSaveSurfaceToFileInMemory() and write the returned buffer to a
Do I have to implement D3DXSaveSurfaceToFileInMemory() first?

More information about the wine-devel mailing list