summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-22 01:33:25 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-22 01:33:25 +0300
commit32adef4efc22afa18be5b8f3858f2f8dd36bbc67 (patch)
tree57e794af8de3d94caaa7c08463020b27d411b38b /src/client.cpp
parent42670ec6e26e0659b885cbdea2af6a9c71049971 (diff)
downloadmanaverse-32adef4efc22afa18be5b8f3858f2f8dd36bbc67.tar.gz
manaverse-32adef4efc22afa18be5b8f3858f2f8dd36bbc67.tar.bz2
manaverse-32adef4efc22afa18be5b8f3858f2f8dd36bbc67.tar.xz
manaverse-32adef4efc22afa18be5b8f3858f2f8dd36bbc67.zip
Fix vsync option on non windows systems with Nvidia closed source driver.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 52d18477f..1ec0c683d 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -507,6 +507,21 @@ void Client::updateEnv()
setEnv("SDL_VIDEO_ALLOW_SCREENSAVER", "1");
else
setEnv("SDL_VIDEO_ALLOW_SCREENSAVER", "0");
+
+#ifndef WIN32
+ const int vsync = config.getIntValue("vsync");
+ switch (vsync)
+ {
+ case 1:
+ Client::setEnv("__GL_SYNC_TO_VBLANK", "0");
+ break;
+ case 2:
+ Client::setEnv("__GL_SYNC_TO_VBLANK", "1");
+ break;
+ default:
+ break;
+ }
+#endif
}
void Client::initGraphics()