From: Vadim Trochinsky Date: Fri, 21 May 2010 21:49:41 +0000 (+0200) Subject: Remove glDrawPixels code for initializing interlaced stereo, replace with line drawin... X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=f20fd8f0f3de63b7bcf8f1082f12db96ab4b7784;p=lugaru.git Remove glDrawPixels code for initializing interlaced stereo, replace with line drawing code, which is simpler and works much faster --- diff --git a/Source/Stereo.cpp b/Source/Stereo.cpp index 5c8be16..b99c18e 100644 --- a/Source/Stereo.cpp +++ b/Source/Stereo.cpp @@ -46,44 +46,49 @@ void InitStereo(StereoMode mode) { fprintf(stderr, "Screen width is %i, height is %i\n", kContextWidth, kContextHeight); + // Setup stencil buffer 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