?/TD> |
Microsoft DirectX 9.0 |
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.
- The source format must be a four-character code (FOURCC) format or a valid back buffer format. For a list of these, see FourCC Formats and BackBuffer or Display Formats.
- The target format must be one of these unsigned formats:
D3DFMT_X1R5G5B5 D3DFMT_A1R5G5B5 D3DFMT_R5G6B5 D3DFMT_R8G8B8 D3DFMT_X8R8G8B8 D3DFMT_A8R8G8B8 D3DFMT_A2R10G10B10 D3DFMT_A16B16G16R16 D3DFMT_A2B10G10R10 D3DFMT_A8B8G8R8 D3DFMT_X8B8G8R8 D3DFMT_A16B16G16R16F D3DFMT_A32B32G32R32F
See Also
IDirect3DDevice9::ColorFill, IDirect3DDevice9::StretchRect