From 819622f40e9dbe1ab18a8eb3b5df447b619a336f Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Mon, 3 Jun 2013 23:09:02 +0000 Subject: [PATCH] I hope this fixes the black flickering when selecting units you sometimes see (this was very obvious with selectbuffer , but visible in colorpicking too ) --- source/glest_game/graphics/renderer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index 4bc17843..316f642f 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -6914,8 +6914,9 @@ void Renderer::selectUsingSelectionBuffer(Selection::UnitContainer &units, printf("%s\n",szBuf); } - glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -6937,7 +6938,6 @@ void Renderer::selectUsingSelectionBuffer(Selection::UnitContainer &units, } //pop matrices - glMatrixMode(GL_PROJECTION); glPopMatrix(); // Added this to ensure all the selection calls are done now @@ -7004,8 +7004,9 @@ void Renderer::selectUsingColorPicking(Selection::UnitContainer &units, PixelBufferWrapper::begin(); - glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glMatrixMode(GL_PROJECTION); glLoadIdentity(); //GLint view[]= {0, 0, metrics.getVirtualW(), metrics.getVirtualH()}; //gluPickMatrix(x, y, w, h, view); @@ -7086,9 +7087,7 @@ void Renderer::selectUsingColorPicking(Selection::UnitContainer &units, } } //pop matrices - glMatrixMode(GL_PROJECTION); glPopMatrix(); - } // ==================== shadows ====================