DirectX SDK

Step 3: Display DirectDraw Device 3-D Capabilities

[C++]

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

[Visual Basic]

Retrieving the 3-D capabilities of a DirectDraw device is very similar to the previous step of this tutorial. First a Direct3D7 object must be created from the DirectDraw7 object. Next, the Direct3D7.GetDevicesEnum method is called to create and fill a Direct3DEnumDevices enumeration object. The methods of the enumeration object are then called to retrieve information about the Direct3D devices present on a system.

In the Tutorial 5 sample, the Direct3DEnumDevices.GetDesc method is called on each Direct3D device to obtain the capabilities. Then capability flags are checked in the D3DDEVICEDESC7 type and the results are reported in the List box. This is shown in the following statements:

Set dd = m_dx.DirectDrawCreate(sGuid)
Set d3d = dd.GetDirect3D()

OutList.AddItem "   D3D devices"

Set d3denum = d3d.GetDevicesEnum()

OutList.AddItem ""

For i = 1 To d3denum.GetCount()

    d3denum.GetDesc i, hwDesc
    OutList.AddItem "     Guid        " + d3denum.GetGuid(i)
    OutList.AddItem "     Description " + d3denum.GetDescription(i)
    OutList.AddItem "     Name        " + d3denum.GetName(i)
    OutList.AddItem "     Device "
    With hwDesc
        OutList.AddItem "     Max Texture Height  " + Str(.lMaxTextureHeight)
        OutList.AddItem "     Max Texture Width   " + Str(.lMaxTextureWidth)
        If (.lDeviceRenderBitDepth And DDBD_8) Then
            OutList.AddItem "     Supports rendering to 8 bit"
        End If
        If (.lDeviceZBufferBitDepth And DDBD_8) Then
            OutList.AddItem "     Supports  8 bit z buffer"
        End If
        If (.lDevCaps And D3DDEVCAPS_TEXTURENONLOCALVIDMEM) Then
            OutList.AddItem "     Supports AGP textures"
        End If
    End With

Next: Step 4: Report Available Display Modes