diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-19 11:13:10 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-19 16:22:58 +0300 |
commit | ba4d23fe37ee626c92c61bf0f78f64dcc2d95114 (patch) | |
tree | 68e34d845b87dbaa19b24dd04952aa71068ca16c /source/blender/editors/space_view3d/view3d_draw_legacy.c | |
parent | 781108cdc6095f126ad0c77411d39acb52f11aa0 (diff) |
Fix node editor drawing when built with core profile
There are two major things in this commit.
First one is to have proper stack for projection matrices. This is
something what OpenGL specification grants to have at least 2 elements
for and what is required to have for proper editor drawing without
refactoring the way how we restore projection matrix.
Supporting this stack have following advantages:
- Our GPU stack is closer to OpenGL specs, making it easier to follow
by other developers who are always familiar with OpenGL.
- Makes it easier to port all editors to a new API.
- Should help us getting rid of extra matrix push/pop added in
various commits to 2.8 branch.
The new API follows the following convention:
- gpuPushMatrix/gpuPopMatrix ALWAYS deals with model view matrix
and nothing more.
While this name does not fully indicate that it's only model view
matrix operator, it matches behavior of other matrix operations
such as transform which also doesn't indicate what matrix type
they are operating on.
- Projection matrix has dedicated calls for push/pop which are
gpuPushProjectionMatrix/gpuPopProjectionMatrix.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw_legacy.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw_legacy.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index e01ac976f95..0d59b9afb14 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -755,7 +755,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glMatrixMode(GL_PROJECTION); - gpuPushMatrix(); + gpuPushProjectionMatrix(); glMatrixMode(GL_MODELVIEW); gpuPushMatrix(); ED_region_pixelspace(ar); @@ -778,7 +778,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, zoomx, zoomy, col); glMatrixMode(GL_PROJECTION); - gpuPopMatrix(); + gpuPopProjectionMatrix(); glMatrixMode(GL_MODELVIEW); gpuPopMatrix(); @@ -1823,7 +1823,7 @@ void ED_view3d_draw_offscreen( } glMatrixMode(GL_PROJECTION); - gpuPushMatrix(); + gpuPushProjectionMatrix(); gpuLoadIdentity(); glMatrixMode(GL_MODELVIEW); gpuPushMatrix(); @@ -2533,7 +2533,7 @@ void view3d_main_region_draw_legacy(const bContext *C, ARegion *ar) bool clip_border = (render_border && !BLI_rcti_compare(&ar->drawrct, &border_rect)); glMatrixMode(GL_PROJECTION); - gpuPushMatrix(); + gpuPushProjectionMatrix(); gpuLoadIdentity(); glMatrixMode(GL_MODELVIEW); gpuPushMatrix(); @@ -2565,7 +2565,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); - gpuPopMatrix(); + gpuPopProjectionMatrix(); glMatrixMode(GL_MODELVIEW); gpuPopMatrix(); |