I hope this fixes the black flickering when selecting units you sometimes see (this was very obvious with selectbuffer , but visible in colorpicking too )

This commit is contained in:
Titus Tscharntke
2013-06-03 23:09:02 +00:00
parent 2e2f16e3bc
commit 819622f40e

View File

@@ -6914,8 +6914,9 @@ void Renderer::selectUsingSelectionBuffer(Selection::UnitContainer &units,
printf("%s\n",szBuf); printf("%s\n",szBuf);
} }
glMatrixMode(GL_PROJECTION);
glPushMatrix(); glPushMatrix();
glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
@@ -6937,7 +6938,6 @@ void Renderer::selectUsingSelectionBuffer(Selection::UnitContainer &units,
} }
//pop matrices //pop matrices
glMatrixMode(GL_PROJECTION);
glPopMatrix(); glPopMatrix();
// Added this to ensure all the selection calls are done now // Added this to ensure all the selection calls are done now
@@ -7004,8 +7004,9 @@ void Renderer::selectUsingColorPicking(Selection::UnitContainer &units,
PixelBufferWrapper::begin(); PixelBufferWrapper::begin();
glMatrixMode(GL_PROJECTION);
glPushMatrix(); glPushMatrix();
glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
//GLint view[]= {0, 0, metrics.getVirtualW(), metrics.getVirtualH()}; //GLint view[]= {0, 0, metrics.getVirtualW(), metrics.getVirtualH()};
//gluPickMatrix(x, y, w, h, view); //gluPickMatrix(x, y, w, h, view);
@@ -7086,9 +7087,7 @@ void Renderer::selectUsingColorPicking(Selection::UnitContainer &units,
} }
} }
//pop matrices //pop matrices
glMatrixMode(GL_PROJECTION);
glPopMatrix(); glPopMatrix();
} }
// ==================== shadows ==================== // ==================== shadows ====================