Index: code/unix/sdl_glimp.c =================================================================== --- code/unix/sdl_glimp.c (revision 1014) +++ code/unix/sdl_glimp.c (working copy) @@ -666,6 +666,12 @@ SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, tstencilbits ); SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); +#ifdef SDL_GL_SWAP_CONTROL + if( SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, r_swapInterval->integer ) ) +#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); @@ -1085,6 +1091,19 @@ */ void GLimp_EndFrame (void) { + + if ( r_swapInterval->modified ) + { + r_swapInterval->modified = qfalse; +#ifdef SDL_GL_SWAP_CONTROL + if( SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, r_swapInterval->integer ) ) + { + ri.Printf( PRINT_ALL, "Warning: SDL_GL_SWAP_CONTROL failed, make sure " + "you have libSDL >= 1.2.10" ); + } +#endif // SDL_GL_SWAP_CONTROL + } + // don't flip if drawing to front buffer if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) {