Microsoft DirectX 9.0

IDirect3D9::EnumAdapterModes Method

Enumerate the available adapter modes.


HRESULT EnumAdapterModes(      

    UINT Adapter,     D3DFORMAT Format,     UINT Mode,     D3DDISPLAYMODE* pMode );


[in] Ordinal number denoting the display adapter to enumerate. 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.
[in] Allowable pixel formats. The application specifies a pixel format, and the enumeration is restricted to those display modes that exactly match the format. Valid formats are: D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_A2R10G10B10, D3DFMT_X1R5G5B5, D3DFMT_A1R5G5B5, and D3DFMT_R5G6B5, which are members of D3DFORMAT.
[in] Represents the adapter mode. This must be set to the display-mode index, which must be in the range of zero to one less than the value returned by IDirect3D9::GetAdapterModeCount. See Remarks.
[out] Array of display modes. Each is of type D3DDISPLAYMODE. See Remarks.

Return Value


The display-mode parameter supports an expanding set of display modes. To protect applications from enumerating formats that were not invented when the application shipped, the application must tell Microsoft?Direct3D?the format for which display modes should be enumerated. The resulting array of display modes will differ only by width, height, and refresh rate.

The application specifies a pixel format and the enumeration is restricted to those display modes that exactly match the format. Allowed formats are D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_A2B10G10R10, D3DFMT_X1R5G5B5, D3DFMT_A1R5G5B5, and D3DFMT_R5G6B5.

Enumeration is equivalent for alpha and non-alpha versions of the same format. The returned format will always be filled with the same format supplied by the application. See D3DDISPLAYMODE

This method treats 565 and 555 as equivalent, and returns the correct version in the format. The difference comes into play only when the application locks the back buffer, and there is an explicit flag that the application must set in order to accomplish this.

© 2002 Microsoft Corporation. All rights reserved.