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...
2EyeGuy
11 years agoAdventurer
Thanks. That fixed it.
Wow, the Rift supports a lot of resolutions, all the way up to 1920x1200.
Wow, the Rift supports a lot of resolutions, all the way up to 1920x1200.
const char *g_hmd_device_name = nullptr;
#ifdef _WIN32
static char hmd_device_name[MAX_PATH] = "";
#endif
#ifdef _WIN32
g_hmd_device_name = hmdDesc.DisplayDeviceName;
const char *p;
if (g_hmd_device_name && (p = strstr(g_hmd_device_name, "\\Monitor")))
{
size_t n = p - g_hmd_device_name;
if (n >= MAX_PATH)
n = MAX_PATH - 1;
g_hmd_device_name = strncpy(hmd_device_name, g_hmd_device_name, n);
hmd_device_name[n] = '\0';
}
#endif
wxArrayString GetListOfResolutions()
{
wxArrayString retlist;
retlist.Add("Auto");
#ifdef _WIN32
DWORD iModeNum = 0;
DEVMODEA dmi;
ZeroMemory(&dmi, sizeof(dmi));
dmi.dmSize = sizeof(dmi);
std::vector<std::string> resos;
#if 0
// Add the HMD's required resolution, even if it isn't listed or supported.
{
char res[100];
sprintf(res, "%dx%d", g_hmd_window_width, g_hmd_window_height);
std::string strRes(res);
if (std::find(resos.begin(), resos.end(), strRes) == resos.end())
{
resos.push_back(strRes);
retlist.Add(StrToWxStr(res));
}
}
#endif
while (EnumDisplaySettingsA(g_hmd_device_name, iModeNum++, &dmi) != 0)
{
char res[100];
sprintf(res, "%dx%d", dmi.dmPelsWidth, dmi.dmPelsHeight);
std::string strRes(res);
// Only add unique resolutions
if (std::find(resos.begin(), resos.end(), strRes) == resos.end())
{
resos.push_back(strRes);
retlist.Add(StrToWxStr(res));
}
}
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