Platform SDK: DirectX

Step 1.2: Enumerate Display Mode Information

[C++]

This section pertains only to application development in Visual Basic. See Direct3D Immediate Mode C/C++ Tutorials.

[Visual Basic]

You can use the DirectDraw7.GetDisplayModesEnum method to return a reference to a DirectDrawEnumModes class. The retrieved display mode information is contained in a DDSURFACEDESC2 type, g_enumInfo:

    Set g_ddEnumModes = g_dd.GetDisplayModesEnum(DDEDM_DEFAULT, g_enumInfo)

In the preceding code the DDEDM_DEFAULT flag tells the application to perform a normal enumeration of the display modes. For more information on available options, see the CONST_DDEDMFLAGS topic in the SDK reference. Now that you have enumerated the DirectDraw driver and the display modes, you can move on to enumerating the devices. The Enumeration application uses the following application-defined subroutine to enumerate the devices:

    ' Enumerate the devices.
    EnumDevices

Device enumeration is explained in Step 1.3: Enumerate Device Information.