Using Direct3D9, I can count the available adapters using IDirect3D9::GetAdapterCount()
. However, this returns the number of outputs, i.e. 2 for a single dual-head graphics card. Using Win32 API, I can enumerate the display devices and the monitors attached 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, which also works correctly if I create the D3D device afterwards using D3DCREATE_ADAPTERGROUP_DEVICE
? If not, are there any assumptions I can make about the enumeration order of the devices which I can use to match the Win32 API results to D3D adapters? In other words: Is the Direct3D adapter 0 guaranteed to be the first adapter returned by EnumDisplayDevices
?
Addition: I just found out, that I could match the device name from D3DADAPTER_IDENTIFIER9
to the device name of Win32. However, is there a way to get just the physical devices from D3D in the first place?