Microsoft DirectX 8.1 (Visual Basic)

Direct3D8.EnumAdapterModes

Enumerates the display modes of an adapter.

object.EnumAdapterModes( _ 
    Adapter As Long, _ 
    Mode As Long, _ 
    DisplayMode As D3DDISPLAYMODE)

Parts

object
Object expression that resolves to a Direct3D8 object.
Adapter
Ordinal number that denotes the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter.
Mode
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.
DisplayMode
A D3DDISPLAYMODE type, to be filled with information describing this mode.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
D3DERR_OUTOFVIDEOMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

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 Direct3D8.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.

See Also

Direct3D8.GetAdapterModeCount