Get rid of glMatrixMode calls

With the explicit calls we don't need to worry about current state
outside of the GPU module now. In fact. we don't need to worry about
current matrix mode in core profile at all.

Legacy OpenGL now has some code which ensures current matrix mode
when using explicit calls to push/pop matrix.
This commit is contained in:
2017-04-19 10:46:05 +02:00
parent 288892bf08
commit 3f11be3f7d
6 changed files with 73 additions and 26 deletions

View File

@@ -1377,9 +1377,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
ui_but_to_pixelrect(&rect, ar, block, NULL);
/* pixel space for AA widgets */
glMatrixMode(GL_PROJECTION);
gpuPushProjectionMatrix();
glMatrixMode(GL_MODELVIEW);
gpuPushMatrix();
gpuLoadIdentity();
@@ -1406,9 +1404,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
}
/* restore matrix */
glMatrixMode(GL_PROJECTION);
gpuPopProjectionMatrix();
glMatrixMode(GL_MODELVIEW);
gpuPopMatrix();
if (multisample_enabled)