diff src/video/x11/SDL_x11gl.c @ 4268:d48035d857d3 SDL-1.2

Make SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) work with GLX_SGI_swap_control. Fixes Bugzilla #697.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 29 Sep 2009 13:50:33 +0000
parents 39e748f251c6
children 91c458013850
line wrap: on
line diff
--- a/src/video/x11/SDL_x11gl.c	Tue Sep 29 13:42:33 2009 +0000
+++ b/src/video/x11/SDL_x11gl.c	Tue Sep 29 13:50:33 2009 +0000
@@ -289,7 +289,9 @@
 		if ( this->gl_data->glXSwapIntervalMESA ) {
 			this->gl_data->glXSwapIntervalMESA(this->gl_config.swap_control);
 		} else if ( this->gl_data->glXSwapIntervalSGI ) {
-			this->gl_data->glXSwapIntervalSGI(this->gl_config.swap_control);
+			if (this->gl_data->glXSwapIntervalSGI(this->gl_config.swap_control) != 0) {
+				this->gl_data->sgi_swap_interval = this->gl_config.swap_control;
+			}
 		}
 	}
 #else
@@ -412,7 +414,10 @@
 	    case SDL_GL_SWAP_CONTROL:
 		if ( this->gl_data->glXGetSwapIntervalMESA ) {
 			*value = this->gl_data->glXGetSwapIntervalMESA();
-			return(0);
+			return 0;
+		} else if ( this->gl_data->glXSwapIntervalSGI ) {
+			*value = this->gl_data->sgi_swap_interval;
+			return 0;
 		} else {
 			unsupported = 1;
 		}