Workaround for refresh rate truncation on Windows.

This commit is contained in:
Dario 2024-04-27 20:43:58 -03:00
parent 92ae002acf
commit e9cdcb0f60

View File

@ -224,6 +224,13 @@ namespace RT64 {
}
refreshRate = displayMode.dmDisplayFrequency;
// FIXME: This function truncates refresh rates that'd otherwise round to the correct rate in most cases.
// This hack will fix most common cases where refresh rates divisble by 10 are truncated to the wrong value.
// This can be removed when a more accurate way to query the refresh rate of the monitor is found.
if ((refreshRate % 10) == 9) {
refreshRate++;
}
# elif defined(__linux__)
// Sourced from: https://stackoverflow.com/a/66865623
XRRScreenResources *screenResources = XRRGetScreenResources(windowHandle.display, windowHandle.window);