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 can't do 1280x800, so the mode I need the other display to use won't be in the list.
Using nullptr isn't an option, because my laptop screen can't do 1280x800, so the mode I need the other display to use won't be in the list.
const char *g_hmd_device_name = nullptr;
g_hmd_device_name = hmdDesc.DisplayDeviceName;
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;
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));
}
ZeroMemory(&dmi, sizeof(dmi));
}
