X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FStereo.cpp;h=6680c43c8acac9d53b32f8d3939d0441f3ff5b1e;hb=1aef858f5ecb3dc8fd816e0155635371ed3632f2;hp=5c8be16dd298e68525f8e52b679ea470e57b639d;hpb=281207f066058c990b4060f50f3029fbddaf8166;p=lugaru.git diff --git a/Source/Stereo.cpp b/Source/Stereo.cpp index 5c8be16..6680c43 100644 --- a/Source/Stereo.cpp +++ b/Source/Stereo.cpp @@ -46,44 +46,61 @@ void InitStereo(StereoMode mode) { fprintf(stderr, "Screen width is %i, height is %i\n", kContextWidth, kContextHeight); + // Setup stencil buffer + glDisable( GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glDisable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); + glEnable( GL_STENCIL_TEST); glClearStencil(0); glClear( GL_STENCIL_BUFFER_BIT ); glStencilFunc(GL_ALWAYS, 0x1, 0x1); glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 3); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glColorMask( 1.0, 1.0, 1.0, 1.0 ); - char stencil[] = {64,127,255}; - + // Setup viewport glViewport(0,0, kContextWidth, kContextHeight); glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho((GLdouble)0, (GLdouble)kContextWidth, (GLdouble)kContextHeight, 0, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - for(int y=0;y