diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-22 01:33:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-22 01:33:25 +0300 |
commit | 32adef4efc22afa18be5b8f3858f2f8dd36bbc67 (patch) | |
tree | 57e794af8de3d94caaa7c08463020b27d411b38b /src | |
parent | 42670ec6e26e0659b885cbdea2af6a9c71049971 (diff) | |
download | manaverse-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')
-rw-r--r-- | src/client.cpp | 15 |
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() |