mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user