From bd09057d6951c77c833d5b45cf86d4493d58fccc Mon Sep 17 00:00:00 2001 From: stephena Date: Sat, 25 Aug 2007 23:57:35 +0000 Subject: [PATCH] Make the 'gl_vsync' argument work with Nvidia cards under Linux. Stella will have to be restarted for this to take effect, so it still isn't the ideal solution. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1359 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/common/mainSDL.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/stella/src/common/mainSDL.cxx b/stella/src/common/mainSDL.cxx index 9e89313df..9541580e1 100644 --- a/stella/src/common/mainSDL.cxx +++ b/stella/src/common/mainSDL.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: mainSDL.cxx,v 1.74 2007-07-27 13:49:16 stephena Exp $ +// $Id: mainSDL.cxx,v 1.75 2007-08-25 23:57:35 stephena Exp $ //============================================================================ #include @@ -138,6 +138,15 @@ int main(int argc, char* argv[]) if(theOSystem->settings().getBool("center")) putenv("SDL_VIDEO_CENTERED=1"); +#ifdef BSPF_UNIX + // Nvidia cards under UNIX don't currently support SDL_GL_SWAP_CONTROL + // So we need to do it with an Nvidia-specific environment variable + // This also means the setting can only be changed by restarting Stella + // This functionality should really be integrated into SDL directly + if(theOSystem->settings().getBool("gl_vsync")) + putenv("__GL_SYNC_TO_VBLANK=1"); +#endif + //// Main loop //// // First we check if a ROM is specified on the commandline. If so, and if // the ROM actually exists, use it to create a new console.