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);
for (UINT i = 0; ::EnumDisplayDevices(NULL, i, &displayDevice, 0); i++) {
for (UINT j = 0; ::EnumDisplayDevices(displayDevice.DeviceName, j,
&displayDevice, 0); j++) {
}
}
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?
source
share