From 32adef4efc22afa18be5b8f3858f2f8dd36bbc67 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 Jun 2014 01:33:25 +0300 Subject: Fix vsync option on non windows systems with Nvidia closed source driver. --- src/client.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') 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() -- cgit v1.2.3-70-g09d2