Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-04-19 11:46:05 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-04-19 16:22:58 +0300
commit3f11be3f7de90517826cb114f648b06fc85b67d4 (patch)
tree3698f730600c6fe119df84c759376f5c2d4fc130 /source/blender/editors/space_view3d/view3d_draw_legacy.c
parent288892bf08f380afdfe7f2f8f5b1ca2d2e037fe3 (diff)
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.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw_legacy.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 0d59b9afb14..88ba8439980 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -754,9 +754,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glMatrixMode(GL_PROJECTION);
gpuPushProjectionMatrix();
- glMatrixMode(GL_MODELVIEW);
gpuPushMatrix();
ED_region_pixelspace(ar);
@@ -777,9 +775,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
immDrawPixelsTex(&state, x1 - centx, y1 - centy, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_LINEAR, ibuf->rect,
zoomx, zoomy, col);
- glMatrixMode(GL_PROJECTION);
gpuPopProjectionMatrix();
- glMatrixMode(GL_MODELVIEW);
gpuPopMatrix();
glDisable(GL_BLEND);
@@ -1822,10 +1818,8 @@ void ED_view3d_draw_offscreen(
GPU_free_images_anim();
}
- glMatrixMode(GL_PROJECTION);
gpuPushProjectionMatrix();
gpuLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
gpuPushMatrix();
gpuLoadIdentity();
@@ -1886,9 +1880,7 @@ void ED_view3d_draw_offscreen(
ar->winy = bwiny;
ar->winrct = brect;
- glMatrixMode(GL_PROJECTION);
gpuPopMatrix();
- glMatrixMode(GL_MODELVIEW);
gpuPopMatrix();
UI_Theme_Restore(&theme_state);
@@ -2532,10 +2524,8 @@ void view3d_main_region_draw_legacy(const bContext *C, ARegion *ar)
bool render_border = ED_view3d_calc_render_border(scene, v3d, ar, &border_rect);
bool clip_border = (render_border && !BLI_rcti_compare(&ar->drawrct, &border_rect));
- glMatrixMode(GL_PROJECTION);
gpuPushProjectionMatrix();
- gpuLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
+ gpuLoadIdentityProjectionMatrix();
gpuPushMatrix();
gpuLoadIdentity();
@@ -2564,9 +2554,7 @@ void view3d_main_region_draw_legacy(const bContext *C, ARegion *ar)
view3d_main_region_draw_info(C, scene, ar, v3d, grid_unit, render_border);
- glMatrixMode(GL_PROJECTION);
gpuPopProjectionMatrix();
- glMatrixMode(GL_MODELVIEW);
gpuPopMatrix();
v3d->flag |= V3D_INVALID_BACKBUF;