?/TD>
Microsoft DirectX 9.0

IDirect3D9::CheckDeviceFormatConversion Method


Tests the device to see if it supports conversion from one display format to another.

Syntax

HRESULT CheckDeviceFormatConversion(      

    UINT Adapter,     D3DDEVTYPE DeviceType,     D3DFORMAT SourceFormat,     D3DFORMAT TargetFormat );

Parameters

Adapter
[in] Display adapter ordinal number. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns D3DERR_INVALIDCALL when this value equals or exceeds the number of display adapters in the system.
DeviceType
[in] Device type. Member of the D3DDEVTYPE enumerated type.
SourceFormat
[in] Source adapter format. Member of the D3DFORMAT enumerated type.
TargetFormat
[in] Target adapter format. Member of the D3DFORMAT enumerated type.

Return Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value is D3DERR_INVALIDCALL.

The method will return D3DERR_NOTAVAILABLE when the hardware doesn't support conversion between the two formats.



Remarks

Using IDirect3D9::CheckDeviceType to test for compatibility between a back buffer that differs from the display format will return appropriate values. This means that the call will reflect device capabilities. If the device cannot render to the requested back buffer format, the call will still return D3DERR_NOTAVAILABLE. If the device can render to the format, but cannot perform the color-converting presentation, the return value will also be D3DERR_NOTAVAILABLE. Applications can discover hardware support for the presentation itself by calling IDirect3D9::CheckDeviceFormatConversion. No software emulation for the color-converting presentation itself will be offered.

IDirect3D9::CheckDeviceFormatConversion can also be used to determine which combinations of source surface formats and destination surface formats are permissible in calls to IDirect3DDevice9::StretchRect.

Color conversion is restricted to the following source and target formats.

See Also

IDirect3DDevice9::ColorFill, IDirect3DDevice9::StretchRect


© 2002 Microsoft Corporation. All rights reserved.