[SDL] cannot enable OpenGL quadbuffer stereo mode on Linux

ITO Nobuaki banb at j-link.ne.jp
Sun May 30 23:03:05 PDT 2004


Hello.

I'm using SDL-1.2 on Linux box with Quadro 4 XGL.  Quadro has the VESA 3pin
stereo port, and I attached the stereo shutter glasses to the card.  Codes
written with GLUT could drive those glasses correctly, but SDL couldn't even
when SDL_GL_SetAttribute(SDL_GL_STEREO, 1) was called.

With some testing programs, finally I found that OpenGL stereo quadbuffer mode
would be enabled in case that glXMakeCurrent() is called properly after
glXCreateContext().  I know SDL_SetVideoMode() does call X11_GL_MakeCurrent(),
but I don't know the reason why it doesn't work.

Quick hack follows.  This patch works fine with SDL-1.2.7.


banb


--- SDL-1.2.7/src/video/x11/SDL_x11gl.c.ste	2004-02-19 02:22:09.000000000 +0900
+++ SDL-1.2.7/src/video/x11/SDL_x11gl.c	2004-05-31 13:25:04.375053196 +0900
@@ -126,7 +126,6 @@

 	if( this->gl_config.stereo ) {
 		attribs[i++] = GLX_STEREO;
-		attribs[i++] = this->gl_config.stereo;
 	}
 	
 	if( this->gl_config.multisamplebuffers ) {
@@ -212,6 +211,13 @@
 		return -1;
 	}

+	if ( ! this->gl_data->glXMakeCurrent(GFX_Display,
+	                                     SDL_Window, glx_context) ) {
+		SDL_SetError("Unable to make GL context current");
+		return -1;
+	}
+	XSync( GFX_Display, False );
+
 	gl_active = 1;
 #else
 	SDL_SetError("X11 driver not configured with OpenGL");




More information about the SDL mailing list