- fix issues with Linux SDL builds following changes to refreshfreq.

This commit is contained in:
Mitchell Richters 2020-04-15 21:51:25 +10:00 committed by Christoph Oelckers
parent 587a5d5d9a
commit 5c3c55b6cd

View file

@ -111,6 +111,8 @@ CCMD(vid_list_sdl_render_drivers)
} }
} }
int refreshfreq;
// PRIVATE DATA DEFINITIONS ------------------------------------------------ // PRIVATE DATA DEFINITIONS ------------------------------------------------
namespace Priv namespace Priv
@ -432,6 +434,19 @@ SDLVideo::SDLVideo ()
Priv::CreateWindow(SDL_WINDOW_HIDDEN); Priv::CreateWindow(SDL_WINDOW_HIDDEN);
} }
#endif #endif
// Get refresh rate for current display.
SDL_DisplayMode display;
if(SDL_GetCurrentDisplayMode(vid_adapter, &display) == 0)
{
refreshfreq = display.refresh_rate;
}
else
{
fprintf(stderr, "Failed to get refresh rate: %s\n", SDL_GetError());
return;
}
} }
SDLVideo::~SDLVideo () SDLVideo::~SDLVideo ()