diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-03-24 04:36:34 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-03-27 04:23:54 +0300 |
commit | 67ffad8cd2b44d7685ec5aec2a76e1cb13d9f7a1 (patch) | |
tree | 3b62b443ab3602476c9f1fe1f42549d4d85f2b41 /source/blender/editors/space_view3d/drawobject.c | |
parent | 59c562337291217c2fbd48adc8b3862c24771d09 (diff) |
OpenGL: remove several glMatrixMode calls
A few of these were redundant, others could be converted to new matrix API.
Part of T49450
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index e41cc4aa2e7..be0a612a8d8 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -934,11 +934,11 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, bool depth_write, flo ED_view3d_clipping_disable(); } - glMatrixMode(GL_PROJECTION); - gpuPushMatrix(); - glMatrixMode(GL_MODELVIEW); - gpuPushMatrix(); + float original_proj[4][4]; + gpuGetProjectionMatrix3D(original_proj); wmOrtho2_region_pixelspace(ar); + + gpuPushMatrix(); gpuLoadIdentity(); if (depth_write) { @@ -973,10 +973,8 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, bool depth_write, flo glDepthMask(GL_TRUE); } - glMatrixMode(GL_PROJECTION); - gpuPopMatrix(); - glMatrixMode(GL_MODELVIEW); gpuPopMatrix(); + gpuLoadProjectionMatrix3D(original_proj); /* TODO: make this more 2D friendly */ if (rv3d->rflag & RV3D_CLIPPING) { ED_view3d_clipping_enable(); |