From ae08d1a6d804a34abf7bfb7d577a0af2bb824832 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sun, 27 Apr 2008 19:07:57 +0000 Subject: [PATCH] This may enable stereo rendering for other devices like shutter glasses, but I don't know whether this works yet. --- code/renderer/tr_cmds.c | 3 --- code/sdl/sdl_glimp.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/code/renderer/tr_cmds.c b/code/renderer/tr_cmds.c index 8cd6ccb1..8986be28 100644 --- a/code/renderer/tr_cmds.c +++ b/code/renderer/tr_cmds.c @@ -91,9 +91,6 @@ void R_InitCommandBuffers( void ) { ri.Printf( PRINT_ALL, "...failed.\n" ); } } - - if(r_stereoEnabled->integer) - glConfig.stereoEnabled = qtrue; } /* diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index b933a865..c378d5d6 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -316,6 +316,18 @@ static int GLimp_SetMode( int mode, qboolean fullscreen ) SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, sdlcolorbits ); SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, tdepthbits ); SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, tstencilbits ); + + if(r_stereoEnabled->integer) + { + glConfig.stereoEnabled = qtrue; + SDL_GL_SetAttribute(SDL_GL_STEREO, 1); + } + else + { + glConfig.stereoEnabled = qfalse; + SDL_GL_SetAttribute(SDL_GL_STEREO, 0); + } + SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); #if 0 // See http://bugzilla.icculus.org/show_bug.cgi?id=3526