mirror of https://github.com/OpenTTD/OpenTTD
Fix: [MinGW32] Can't convert lambda to stdcall
parent
3ca0239985
commit
2df48a78cc
|
@ -914,24 +914,27 @@ void VideoDriver_Win32Base::EditBoxLostFocus()
|
||||||
SetCandidatePos(this->main_wnd);
|
SetCandidatePos(this->main_wnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hDC, LPRECT rc, LPARAM data)
|
||||||
|
{
|
||||||
|
auto &list = *reinterpret_cast<std::vector<int>*>(data);
|
||||||
|
|
||||||
|
MONITORINFOEX monitorInfo = {};
|
||||||
|
monitorInfo.cbSize = sizeof(MONITORINFOEX);
|
||||||
|
GetMonitorInfo(hMonitor, &monitorInfo);
|
||||||
|
|
||||||
|
DEVMODE devMode = {};
|
||||||
|
devMode.dmSize = sizeof(DEVMODE);
|
||||||
|
devMode.dmDriverExtra = 0;
|
||||||
|
EnumDisplaySettings(monitorInfo.szDevice, ENUM_CURRENT_SETTINGS, &devMode);
|
||||||
|
|
||||||
|
if (devMode.dmDisplayFrequency != 0) list.push_back(devMode.dmDisplayFrequency);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<int> VideoDriver_Win32Base::GetListOfMonitorRefreshRates()
|
std::vector<int> VideoDriver_Win32Base::GetListOfMonitorRefreshRates()
|
||||||
{
|
{
|
||||||
std::vector<int> rates = {};
|
std::vector<int> rates = {};
|
||||||
EnumDisplayMonitors(nullptr, nullptr, [](HMONITOR hMonitor, HDC hDC, LPRECT rc, LPARAM data) -> BOOL {
|
EnumDisplayMonitors(nullptr, nullptr, MonitorEnumProc, reinterpret_cast<LPARAM>(&rates));
|
||||||
auto &list = *reinterpret_cast<std::vector<int>*>(data);
|
|
||||||
|
|
||||||
MONITORINFOEX monitorInfo = {};
|
|
||||||
monitorInfo.cbSize = sizeof(MONITORINFOEX);
|
|
||||||
GetMonitorInfo(hMonitor, &monitorInfo);
|
|
||||||
|
|
||||||
DEVMODE devMode = {};
|
|
||||||
devMode.dmSize = sizeof(DEVMODE);
|
|
||||||
devMode.dmDriverExtra = 0;
|
|
||||||
EnumDisplaySettings(monitorInfo.szDevice, ENUM_CURRENT_SETTINGS, &devMode);
|
|
||||||
|
|
||||||
if (devMode.dmDisplayFrequency != 0) list.push_back(devMode.dmDisplayFrequency);
|
|
||||||
return true;
|
|
||||||
}, reinterpret_cast<LPARAM>(&rates));
|
|
||||||
return rates;
|
return rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue