r1088 - in trunk/code: renderer unix

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon May 21 23:42:32 EDT 2007


Author: tjw
Date: 2007-05-21 23:42:32 -0400 (Mon, 21 May 2007)
New Revision: 1088

Modified:
   trunk/code/renderer/tr_init.c
   trunk/code/unix/sdl_glimp.c
Log:
* (bug 2972) add r_swapInterval support to SDL client (if libSDL >= 1.2.10)


Modified: trunk/code/renderer/tr_init.c
===================================================================
--- trunk/code/renderer/tr_init.c	2007-05-22 02:24:10 UTC (rev 1087)
+++ trunk/code/renderer/tr_init.c	2007-05-22 03:42:32 UTC (rev 1088)
@@ -979,7 +979,12 @@
 	r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "1", CVAR_ARCHIVE );
 	r_finish = ri.Cvar_Get ("r_finish", "0", CVAR_ARCHIVE);
 	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
+#if USE_SDL_VIDEO
+	r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0",
+					CVAR_ARCHIVE | CVAR_LATCH );
+#else
 	r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0", CVAR_ARCHIVE );
+#endif
 	r_gamma = ri.Cvar_Get( "r_gamma", "1", CVAR_ARCHIVE );
 	r_facePlaneCull = ri.Cvar_Get ("r_facePlaneCull", "1", CVAR_ARCHIVE );
 

Modified: trunk/code/unix/sdl_glimp.c
===================================================================
--- trunk/code/unix/sdl_glimp.c	2007-05-22 02:24:10 UTC (rev 1087)
+++ trunk/code/unix/sdl_glimp.c	2007-05-22 03:42:32 UTC (rev 1088)
@@ -689,6 +689,13 @@
     SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, tstencilbits );
     SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
 
+#if SDL_VERSION_ATLEAST( 1, 2, 10 )
+    if( SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, r_swapInterval->integer ) )
+        ri.Printf( PRINT_ALL, "r_swapInterval requires libSDL >= 1.2.10\n" );
+#else
+    #warning libSDL >= 1.2.10  required for r_swapInterval support
+#endif // SDL_GL_SWAP_CONTROL
+
     SDL_WM_SetCaption(CLIENT_WINDOW_TITLE, CLIENT_WINDOW_ICON);
     SDL_ShowCursor(0);
     SDL_EnableUNICODE(1);




More information about the quake3-commits mailing list