From 5c3c55b6cdb3de6c4cd7d78e0a6f1ac875ce421f Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 15 Apr 2020 21:51:25 +1000 Subject: [PATCH] - fix issues with Linux SDL builds following changes to refreshfreq. --- source/platform/posix/sdl/sdlglvideo.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/platform/posix/sdl/sdlglvideo.cpp b/source/platform/posix/sdl/sdlglvideo.cpp index 60217d180..48dd0da35 100644 --- a/source/platform/posix/sdl/sdlglvideo.cpp +++ b/source/platform/posix/sdl/sdlglvideo.cpp @@ -111,6 +111,8 @@ CCMD(vid_list_sdl_render_drivers) } } +int refreshfreq; + // PRIVATE DATA DEFINITIONS ------------------------------------------------ namespace Priv @@ -432,6 +434,19 @@ SDLVideo::SDLVideo () Priv::CreateWindow(SDL_WINDOW_HIDDEN); } #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 ()