Added a 'refreshrate' field to the table returned by love.window.getMode. The value may be 0 if the refresh rate of the monitor can't be determined. It might also be 59 instead of 60 on 59.94hz monitors on some operating systems.

This commit is contained in:
Alex Szpakowski
2014-08-20 20:22:46 -03:00
parent 9e93d854b8
commit e1f7e4abd3
4 changed files with 16 additions and 4 deletions
+6
View File
@@ -390,6 +390,12 @@ void Window::updateSettings(const WindowSettings &newsettings)
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
curMode.settings.sRGB = newsettings.sRGB;
SDL_DisplayMode dmode = {};
SDL_GetCurrentDisplayMode(curMode.settings.display, &dmode);
// May be 0 if the refresh rate can't be determined.
curMode.settings.refreshrate = (double) dmode.refresh_rate;
}
void Window::getWindow(int &width, int &height, WindowSettings &settings)