diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-01 18:32:55 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-01 18:32:55 +0300 |
commit | 81cd4edfb66569f25d518d1fb3526acf7701c773 (patch) | |
tree | 57091c1d5d1c1cd8189c932a881ed203eb595d3d /source/blender/editors/space_node/drawnode.c | |
parent | 90e2b22feeb142d190b7aa2dd1e98fdd48f572bc (diff) |
Fix #20891: opengl animation render could mess up the view.
The problem was that wmPushMatrix/wmOrtho/.. and similar functions did not
work well for offscreen rendering. It would have been possible to make a
fake subwindow for this, but I decided to just remove this extra layer as
it does not seem to have much purpose and has been quite confusing when
trying to fix other bugs. The relevant matrices are already stored in
RegionView3D so there will be no increase in calls to glGetFloat, which may
have been a performance reason to use this system in the past.
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index fe5c7bca3a6..b914411aeeb 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1271,8 +1271,11 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage) if(ibuf) { float x, y; - wmPushMatrix(); - + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + /* somehow the offset has to be calculated inverse */ glaDefine2DArea(&ar->winrct); @@ -1293,7 +1296,10 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage) if(ibuf->rect) glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - wmPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); } BKE_image_release_ibuf(ima, lock); |