How to determine which displays are connected to the same physical device using Direct3D9?

Using Direct3D9, I can count the available adapters using IDirect3D9::GetAdapterCount(). However, this returns the number of outputs, i.e. 2 for one video card with two heads. Using the Win32 API, I can list the display devices and connected monitors using the following snippet:

DISPLAY_DEVICE displayDevice;
::ZeroMemory(&displayDevice, sizeof(displayDevice));
displayDevice.cb = sizeof(displayDevice);

/* Enumerate adapters. */
for (UINT i = 0; ::EnumDisplayDevices(NULL, i, &displayDevice, 0); i++) {

    /* Enumerate the monitors. */
    for (UINT j = 0; ::EnumDisplayDevices(displayDevice.DeviceName, j, 
            &displayDevice, 0); j++) {
        // Do stuff here
    } 
}

My questions are: is there an equivalent for this in D3D that also works correctly if I then create a D3D device using D3DCREATE_ADAPTERGROUP_DEVICE? If not, are there any suggestions that I can make about the listing order of devices that I can use to match the results of the Win32 API for D3D adapters? In other words: is the Direct3D 0 adapter guaranteed to be the first adapter returned EnumDisplayDevices?

Addition: I just found out that I can match the device D3DADAPTER_IDENTIFIER9name with the Win32 device name. However, is there a way to get only physical devices from D3D in the first place?

+3
source share
1 answer

, - , , : NumberOfAdaptersInGroup D3DCAPS9 ( ) ( "" ). MSDN:

NumberOfAdaptersInGroup - 1 1 . 0 . , .

+2

Source: https://habr.com/ru/post/1705325/


All Articles