We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 95

Summary: cannot enable OpenGL quadbuffer stereo mode on Linux
Product: SDL Reporter: Sam Lantinga <slouken>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: don't know   
Hardware: x86   
OS: Linux   

Description Sam Lantinga 2006-01-27 02:32:34 UTC
Date: Mon, 31 May 2004 15:03:05 +0900
From: ITO Nobuaki <banb@j-link.ne.jp>
Subject: [SDL] cannot enable OpenGL quadbuffer stereo mode on Linux

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.

--- 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");
Comment 1 Ryan C. Gordon 2006-01-27 11:23:28 UTC
Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

Comment 2 Sam Lantinga 2006-04-27 06:05:15 UTC
This should be fixed in SVN.