X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FStereo.cpp;h=6680c43c8acac9d53b32f8d3939d0441f3ff5b1e;hb=8429a5ba7c063e1834a63a963ff6ed5bdac6a9cf;hp=b99c18e896e556c837a773d7031d238ebd824382;hpb=37aebc9e3fe24a45f04b35ff27e9d767014f3247;p=lugaru.git diff --git a/Source/Stereo.cpp b/Source/Stereo.cpp index b99c18e..6680c43 100644 --- a/Source/Stereo.cpp +++ b/Source/Stereo.cpp @@ -47,6 +47,11 @@ 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 ); @@ -62,25 +67,27 @@ void InitStereo(StereoMode mode) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); - glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE ); - + glDisable(GL_LINE_SMOOTH); + + // Add 0.5 to the coordinates, because OpenGL considers a pixel should be + // turned on when a line passes through the center of it. if ( mode == stereoHorizontalInterlaced ) { for(int y=0;y