Microsoft DirectX 8.1 (C++)

IDirect3D8::EnumAdapterModes

Enumerates the display modes of an adapter.

HRESULT EnumAdapterModes(
  UINT Adapter,
  UINT Mode,
  D3DDISPLAYMODE* pMode
);

Parameters

Adapter
[in] Ordinal number that denotes the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter.
Mode
[in] Ordinal number that denotes the mode to enumerate. D3DCURRENT_DISPLAY_MODE is a special value denoting the current desktop display mode on this adapter and cannot be specified for this method. See Remarks.
pMode
[in, out] Pointer to a D3DDISPLAYMODE structure, to be filled with information describing this mode. On error conditions, this value is zeroed.

Return Values

If the method succeeds, the return value is D3D_OK.

If Adapter or Mode is out of range, or pMode is invalid, this method returns D3DERR_INVALIDCALL.

Remarks

Some display drivers include refresh rate information that will greatly increase the number of modes. On older drivers, refresh rates of D3DADAPTER_DEFAULT are the only ones enumerated. Direct3D attempts to limit display modes and refresh rates based on the monitor capabilities, however there is still some risk that an enumerated mode will not be supported by the system's monitor. You may want to implement a display mode testing facility similar to that used by the Microsoft® Windows® Display Control Panel utility.

Use IDirect3D8::GetAdapterModeCount to determine the total number of modes supported by the system. Valid values for the Mode parameter range from 0 to the total number of modes minus 1.

Requirements

  Header: Declared in D3d8.h.
  Import Library: Use D3d8.lib.

See Also

IDirect3D8::GetAdapterModeCount