DirectX SDK

D3DXGetSurfaceFormat

The D3DXGetSurfaceFormat function describes one of the supported surface formats for this device.

HRESULT D3DXGetSurfaceFormat(
  DWORD deviceIndex,
  D3DX_VIDMODEDESC* pDesc,
  DWORD surfClassFlags,
  DWORD surfaceIndex,
  D3DX_SURFACEFORMAT* pFormat
); 

Parameters

deviceIndex
An index value specifying the device. Using D3DX_DEFAULT for this parameter specifies the device with the highest acceleration level afforded on the primary surface.
pDesc
A pointer to a D3DX_VIDMODEDESC structure describing the display mode at which the supported surface formats are requested. If this parameter is NULL, the current display mode is assumed.
surfClassFlags
A member of the D3DX_SURFACECLASS enumerated type, indicating the surface classes whose supported formats are requested.
surfaceIndex
A DWORD value, indicating which surface formats to retrieve. Indexing begins at zero.
pFormat
A pointer to a member of the D3DX_SURFACEFORMAT enumerated type; the returned surface format.

Return Values

If the function succeeds, the return value is S_OK.

If the function fails, the return value may be one of the following values:

D3DXERR_D3DXNOTSTARTEDYET
D3DXERR_INITFAILED
D3DXERR_INVALIDD3DXDEVICEINDEX
D3DXERR_INVALIDPARAMETER
D3DXERR_NULLPOINTER

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dxcore.h.
  Library: Use d3dx.lib.

See Also

D3DXGetMaxSurfaceFormats