#1 OpenGL Quad Buffer Stereo

Feature Request
closed
None
5
2007-10-24
2000-01-17
Delman Lee
No

OK, let's get this bug tracking list going :>

The following patch:

. Enables OpenGL quad buffer stereo for X11, which appears to be commented out. I have tested it on an SGI Octane Impact & SGI Onyx Infinite Reality.

. Fixes some typos when using SGI own divided screen stereo mode.

. On SGI there are two ways of doing stereo, quad buffer and divided screen. See

http://toolbox.sgi.com/TasteOfDT/documents/OpenGL/OGLonSGS/OpenGLonSGI-30.html

for details. Changed STEREO to DIVIDED_SCREEN_STEREO to refect this.

Delman
-------------------

--- togl.c 1998/10/09 17:44:31 1.4
+++ togl.c 2000/01/17 16:36:14 1.6
@@ -269,7 +275,7 @@

-#if defined(__sgi) && defined(STEREO)
+#if defined(__sgi) && defined(DIVIDED_SCREEN_STEREO)
/* SGI-only stereo */
static void stereoMakeCurrent( Display *dpy, Window win, GLXContext ctx );
static void stereoInit( struct Togl *togl,int stereoEnabled );
@@ -850,11 +856,11 @@
glXMakeCurrent( Tk_Display(togl->TkWin),
Tk_WindowId(togl->TkWin),
togl->GlCtx );
-#if defined(__sgi) && defined(STEREO)
+#if defined(__sgi) && defined(DIVIDED_SCREEN_STEREO)
stereoMakeCurrent( Tk_Display(togl->TkWin),
Tk_WindowId(togl->TkWin),
togl->GlCtx );
-#endif /*__sgi STEREO */
+#endif /*__sgi DIVIDED_SCREEN_STEREO */
#endif /* WIN32 */
}

@@ -890,11 +896,11 @@
glXMakeCurrent( Tk_Display(togl->TkWin),
togl->OverlayWindow,
togl->OverlayCtx );
-#if defined(__sgi) && defined(STEREO)
+#if defined(__sgi) && defined(DIVIDED_SCREEN_STEREO)
stereoMakeCurrent( Tk_Display(togl->TkWin),
togl->OverlayWindow,
togl->OverlayCtx );
-#endif /*__sgi STEREO */
+#endif /*__sgi DIVIDED_SCREEN_STEREO */
#endif /* WIN32 */
togl->OverlayDisplayProc(togl);
}
@@ -1467,12 +1473,12 @@
directCtx = GL_FALSE;
}

- /* stereo hack */
- /*
- if (togl->StereoFlag) {
+#if !defined(__sgi) || !defined(DIVIDED_SCREEN_STEREO)
+ if (togl->StereoFlag) {
attrib_list[attrib_count++] = GLX_STEREO;
- }
- */
+ }
+#endif
+
attrib_list[attrib_count++] = None;

visinfo = glXChooseVisual( dpy, DefaultScreen(dpy), attrib_list );
@@ -2529,11 +2535,11 @@
glXMakeCurrent( Tk_Display(togl->TkWin),
togl->OverlayWindow,
togl->OverlayCtx );
-#if defined(__sgi) && defined(STEREO)
+#if defined(__sgi) && defined(DIVIDED_SCREEN_STEREO)
stereoMakeCurrent( Tk_Display(togl->TkWin),
togl->OverlayWindow,
togl->OverlayCtx );
-#endif /* __sgi STEREO */
+#endif /* __sgi DIVIDED_SCREEN_STEREO */
#endif /*WIN32 */
}
else if (layer==TOGL_NORMAL) {
@@ -2544,11 +2550,11 @@
glXMakeCurrent( Tk_Display(togl->TkWin),
Tk_WindowId(togl->TkWin),
togl->GlCtx );
-#if defined(__sgi) && defined(STEREO)
+#if defined(__sgi) && defined(DIVIDED_SCREEN_STEREO)
stereoMakeCurrent( Tk_Display(togl->TkWin),
Tk_WindowId(togl->TkWin),
togl->GlCtx );
-#endif /* __sgi STEREO */
+#endif /* __sgi DIVIDED_SCREEN_STEREO */
#endif /* WIN32 */
}
else {
@@ -3047,7 +3053,7 @@
* This code was based on SGI's /usr/share/src/OpenGL/teach/stereo
*/

-#if defined(__sgi) && defined(STEREO)
+#if defined(__sgi) && defined(DIVIDED_SCREEN_STEREO)

static struct stereoStateRec {
Bool useSGIStereo;
@@ -3113,19 +3119,19 @@
drawBuffer = stereo.currentDrawBuffer;
switch (drawBuffer) {
case GL_FRONT:
- stereoDrawBuffer(GL_FRONT_RIGHT);
+ Togl_StereoDrawBuffer(GL_FRONT_RIGHT);
glClear(mask);
- stereoDrawBuffer(drawBuffer);
+ Togl_StereoDrawBuffer(drawBuffer);
break;
case GL_BACK:
- stereoDrawBuffer(GL_BACK_RIGHT);
+ Togl_StereoDrawBuffer(GL_BACK_RIGHT);
glClear(mask);
- stereoDrawBuffer(drawBuffer);
+ Togl_StereoDrawBuffer(drawBuffer);
break;
case GL_FRONT_AND_BACK:
- stereoDrawBuffer(GL_RIGHT);
+ Togl_StereoDrawBuffer(GL_RIGHT);
glClear(mask);
- stereoDrawBuffer(drawBuffer);
+ Togl_StereoDrawBuffer(drawBuffer);
break;
case GL_LEFT:
case GL_FRONT_LEFT:
@@ -3161,7 +3167,7 @@
if (ctx && (ctx != stereo.currentContext)) {
GLint drawBuffer;
glGetIntegerv(GL_DRAW_BUFFER, &drawBuffer);
- stereoDrawBuffer((GLenum) drawBuffer);
+ Togl_StereoDrawBuffer((GLenum) drawBuffer);
}
stereo.currentDisplay = dpy;
stereo.currentWindow = win;
@@ -3194,4 +3200,4 @@
glTranslatef(-eyeShift, 0.0, 0.0);
}

-#endif /* __sgi STEREO */
+#endif /* __sgi DIVIDED_SCREEN_STEREO */

Discussion

  • Greg Couch

    Greg Couch - 2007-10-24

    Logged In: YES
    user_id=131838
    Originator: NO

    Fixed in version 1.7, quad-buffered stereo support is on by default. Version 2.0 adds more stereo options.

     
  • Greg Couch

    Greg Couch - 2007-10-24
    • status: open --> closed
     

Log in to post a comment.