Platform SDK: DirectX

Step 2.1: Retrieve the Device

[Visual Basic]

The information in this section pertains only to applications written in C and C++. See Direct3D Immediate Mode Visual Basic Tutorials.

[C++]

Before you can test a device, you must retrieve the device that you want to test. The following section explains how to retrieve device information, so that you can test the device for all of its supported display settings.

 for( DWORD i=0; i<pDriverInfo->dwNumModes; i++ )
    {
        DDSURFACEDESC2 ddsdMode = pDriverInfo->ddsdModes[i];
        DWORD dwModeDepth = ddsdMode.ddpfPixelFormat.dwRGBBitCount;
        DWORD dwBitDepth  = pDeviceInfo->ddDeviceDesc.dwDeviceRenderBitDepth;
        BOOL  bCompatible = FALSE;

The preceding variable assignments retrieve a video mode description for the device, retrieve the bits per pixel support in the returned video mode description, and retrieve the device's rendering bit depth. This information will be used to test the capabilities of the device.

Now that you have the information on the device that you want to test, you can test the device. This step is explained in Step 2.2: Test the Device.