From 7582d0d20c7b59be9a19ec49bb29d7c971e6835d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 13 Sep 2017 22:23:00 +0300 Subject: Fix compilation with SDL 2 < 2.0.2. --- src/utils/sdl2helper.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/utils') diff --git a/src/utils/sdl2helper.cpp b/src/utils/sdl2helper.cpp index ad559b0e6..68fb9cf4d 100644 --- a/src/utils/sdl2helper.cpp +++ b/src/utils/sdl2helper.cpp @@ -218,12 +218,16 @@ void SDL::allowScreenSaver(const bool allow) { if (allow) { +#if SDL_VERSION_ATLEAST(2, 0, 2) SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); +#endif // SDL_VERSION_ATLEAST(2, 0, 2) SDL_EnableScreenSaver(); } else { +#if SDL_VERSION_ATLEAST(2, 0, 2) SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "0"); +#endif // SDL_VERSION_ATLEAST(2, 0, 2) SDL_DisableScreenSaver(); } } -- cgit v1.2.3-70-g09d2