From 87d2e439eb9631b203500aad7e33499eee64892e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 3 Jan 2004 06:58:30 +0000 Subject: [PATCH] hack to support vsync on nVidia cards in Linux --- .../src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp index 99914ee88a..f0561a87f8 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp @@ -102,6 +102,16 @@ CString LowLevelWindow_SDL::TryVideoMode( RageDisplay::VideoModeParams p, bool & #if defined(_WINDOWS) SDL_SetRefreshRate( (p.rate == REFRESH_DEFAULT)? SDL_REFRESH_DEFAULT:p.rate ); +#elif defined(LINUX) + /* nVidia cards: + * + * This only works the first time we set up a window; after that, the + * drivers appear to cache the value, so you have to actually restart + * the program to change it again. */ + static char buf[128]; + strcpy( buf, "__GL_SYNC_TO_VBLANK=" ); + strcat( buf, p.vsync?"1":"0" ); + putenv( buf ); #endif #if defined(WIN32)