summaryrefslogtreecommitdiff
path: root/src/utils/sdl2helper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-13 22:23:00 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-13 22:23:00 +0300
commit7582d0d20c7b59be9a19ec49bb29d7c971e6835d (patch)
tree387f477069966819da8ba696a6a3bebf4102aae9 /src/utils/sdl2helper.cpp
parent86b19d64c2692665aba33e44ee5db6cbf36b6342 (diff)
downloadmv-7582d0d20c7b59be9a19ec49bb29d7c971e6835d.tar.gz
mv-7582d0d20c7b59be9a19ec49bb29d7c971e6835d.tar.bz2
mv-7582d0d20c7b59be9a19ec49bb29d7c971e6835d.tar.xz
mv-7582d0d20c7b59be9a19ec49bb29d7c971e6835d.zip
Fix compilation with SDL 2 < 2.0.2.
Diffstat (limited to 'src/utils/sdl2helper.cpp')
-rw-r--r--src/utils/sdl2helper.cpp4
1 files changed, 4 insertions, 0 deletions
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();
}
}