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_node | |
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_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index f4ed3c06328..3b3a11f3269 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3176,7 +3176,7 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode, b float x, y; glMatrixMode(GL_PROJECTION); - gpuPushMatrix(); + gpuPushProjectionMatrix(); glMatrixMode(GL_MODELVIEW); gpuPushMatrix(); @@ -3264,7 +3264,7 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode, b } glMatrixMode(GL_PROJECTION); - gpuPopMatrix(); + gpuPopProjectionMatrix(); glMatrixMode(GL_MODELVIEW); gpuPopMatrix(); } diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index cb5f434849e..f80d47b1974 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1189,7 +1189,7 @@ void node_set_cursor(wmWindow *win, SpaceNode *snode, float cursor[2]) void node_draw_default(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node, bNodeInstanceKey key) { glMatrixMode(GL_PROJECTION); - gpuPushMatrix(); + gpuPushProjectionMatrix(); glMatrixMode(GL_MODELVIEW); gpuPushMatrix(); @@ -1199,7 +1199,7 @@ void node_draw_default(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTr node_draw_basis(C, ar, snode, ntree, node, key); glMatrixMode(GL_PROJECTION); - gpuPopMatrix(); + gpuPopProjectionMatrix(); glMatrixMode(GL_MODELVIEW); gpuPopMatrix(); } |