Platform SDK: DirectX

Step 1.1: Enumerate Driver Information

[C++]

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

[Visual Basic]

Create a display driver for your application by calling DirectX7.DirectDrawCreate on the global DirectX7 object:

    Set g_dd = g_dx.DirectDrawCreate("")

Now, you can retrieve driver information. For this simple tutorial we are just using the primary display driver:

    Set g_ddEnum = g_dx.GetDDEnum()
    
    For i = 1 To g_ddEnum.GetCount()
        g_sDriverGUID = g_ddEnum.GetDescription(i)
    Next I

The preceding code fragment uses the DirectX7.GetDDEnum method to create a DirectDrawEnum object. Then, the DirectDrawEnum object, g_ddEnum, is used to enumerate the video driver display adapters installed on the system. When the primary display driver is found, DirectDrawEnum.GetDescription is used to return the driver description of the specified DirectDraw device.

The Enumeration sample application uses the following application-defined subroutine call to perform display mode enumeration:

    ' Enumerate the display modes.
    EnumModes

The details of display mode enumeration are illustrated in Step 1.2: Enumerate Display Mode Information.