Microsoft DirectX 8.1 (Visual Basic) |
Enumerates the display modes of an adapter.
object.EnumAdapterModes( _ Adapter As Long, _ Mode As Long, _ DisplayMode As D3DDISPLAYMODE)
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.
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.