From 8429a5ba7c063e1834a63a963ff6ed5bdac6a9cf Mon Sep 17 00:00:00 2001 From: Vadim Trochinsky Date: Sun, 23 May 2010 17:24:30 +0400 Subject: [PATCH] Fix changing to interlaced mode while running. Fix interlaced mode with FSAA enabled. --- Source/Stereo.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) 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