Forum Discussion
2EyeGuy
11 years agoAdventurer
EnumDisplaySettings not working.
EnumDisplaySettingsA works fine when I pass nullptr, but when I pass hmdDesc.DisplayDeviceName it returns no results. Does anyone know why? Using nullptr isn't an option, because my laptop screen c...
PathogenDavid
11 years agoHonored Guest
Can you print out hmdDesc.DisplayDeviceName and check what it was? It looks like Oculus might be putting the wrong value in there, but I don't have a DK1 to test the behavior to be sure.
If you get something like \\.\DISPLAY2 then you should be fine, but if you get something like \\.\DISPLAY2\Monitor0 then you can't use it directly with EnumDisplaySettings because it expects the former.
I made a small playground for testing EnumDisplayDevices and EnumDisplaySettings (Available here) As you can see on this output, you won't get any display modes out of EnumDisplaySettings if you use a \\.\DISPLAY#\Monitor# device string.
In LibOVR 0.3.2, in OVR_Win32_HMDDevice.cpp on line 285, you can see that the device name that is used is the one from the second call to EnumDisplayDevices, which is the one that gives you the monitor device string, not the display one.
---
EDIT: Also, not immediately on topic: But you need to set dmidmSize again after you call ZeroMemory on dmi. Either that or just skip the ZeroMemory, you don't really need it. Also, you need to set dmi.dmDriverExtra as per the documentation.
If you get something like \\.\DISPLAY2 then you should be fine, but if you get something like \\.\DISPLAY2\Monitor0 then you can't use it directly with EnumDisplaySettings because it expects the former.
I made a small playground for testing EnumDisplayDevices and EnumDisplaySettings (Available here) As you can see on this output, you won't get any display modes out of EnumDisplaySettings if you use a \\.\DISPLAY#\Monitor# device string.
In LibOVR 0.3.2, in OVR_Win32_HMDDevice.cpp on line 285, you can see that the device name that is used is the one from the second call to EnumDisplayDevices, which is the one that gives you the monitor device string, not the display one.
---
EDIT: Also, not immediately on topic: But you need to set dmidmSize again after you call ZeroMemory on dmi. Either that or just skip the ZeroMemory, you don't really need it. Also, you need to set dmi.dmDriverExtra as per the documentation.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 months ago
- 5 years ago
- 2 years ago