Commit f49dfd81 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: fix bug where the desktop refresh rate was being ignored in windowed...

engine: fix bug where the desktop refresh rate was being ignored in windowed mode, always print refresh rate to console on video mode change
parent 678efd58
......@@ -1590,6 +1590,8 @@ void setvideomode_sdlcommonpost(int32_t x, int32_t y, int32_t c, int32_t fs, int
SDL_DisplayMode desktopmode;
SDL_GetDesktopDisplayMode(newdisplayindex, &desktopmode);
refreshfreq = desktopmode.refresh_rate;
int const matchedResolution = (desktopmode.w == x && desktopmode.h == y);
int const borderless = (r_borderless == 1 || (r_borderless == 2 && matchedResolution)) ? SDL_WINDOW_BORDERLESS : 0;
......@@ -1610,10 +1612,10 @@ void setvideomode_sdlcommonpost(int32_t x, int32_t y, int32_t c, int32_t fs, int
else
#endif
refreshfreq = newmode.refresh_rate;
VLOG_F(LOG_GFX, "Refresh rate: %.2fHz.", refreshfreq);
}
VLOG_F(LOG_GFX, "Refresh rate: %.2fHz.", refreshfreq);
SDL_SetWindowSize(sdl_window, x, y);
if (fs)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment