diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-03-21 23:08:14 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-03-21 23:11:55 +0300 |
commit | 3bd831d1d61634e533227bccc04a46574289b774 (patch) | |
tree | d13653a64c6a9e514653d08ada6b642b79281e6d /source/blender/editors/animation | |
parent | 7870bde275a23b78198dc9d943e8dfe7a05a8b01 (diff) |
OpenGL: convert to new matrix API (part 4)
Part of T49450, fixes a Push/Pop mismatch from part yesterday's 3.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_draw.c | 8 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 1d71ba8dc34..5d357e2f93e 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -58,13 +58,12 @@ #include "RNA_access.h" -#include "BIF_gl.h" - #include "UI_interface.h" #include "UI_resources.h" #include "UI_view2d.h" #include "GPU_immediate.h" +#include "GPU_matrix.h" /* *************************************************** */ /* CURRENT FRAME DRAWING */ @@ -81,8 +80,9 @@ static void draw_cfra_number(Scene *scene, View2D *v2d, const float cfra, const int slen; /* because the frame number text is subject to the same scaling as the contents of the view */ + gpuPushMatrix(); UI_view2d_scale_get(v2d, &xscale, &yscale); - glScalef(1.0f / xscale, 1.0f, 1.0f); + gpuScale2f(1.0f / xscale, 1.0f); /* get timecode string * - padding on str-buf passed so that it doesn't sit on the frame indicator @@ -115,7 +115,7 @@ static void draw_cfra_number(Scene *scene, View2D *v2d, const float cfra, const UI_fontstyle_draw_simple(fstyle, x - 0.25f * U.widget_unit, y + 0.15f * U.widget_unit, numstr, col); /* restore view transform */ - glScalef(xscale, 1.0, 1.0); + gpuPopMatrix(); } /* General call for drawing current frame indicator in animation editor */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index cc5957003b6..9d7d1535eb3 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -56,10 +56,10 @@ #include "WM_api.h" #include "WM_types.h" -#include "BIF_gl.h" #include "BIF_glutil.h" #include "GPU_immediate.h" +#include "GPU_matrix.h" #include "UI_interface.h" #include "UI_interface_icons.h" @@ -464,7 +464,8 @@ void ED_markers_draw(const bContext *C, int flag) /* no time correction for framelen! space is drawn with old values */ ypixels = BLI_rcti_size_y(&v2d->mask); UI_view2d_scale_get(v2d, &xscale, &yscale); - glScalef(1.0f / xscale, 1.0f, 1.0f); + gpuPushMatrix(); + gpuScale2f(1.0f / xscale, 1.0f); /* x-bounds with offset for text (adjust for long string, avoid checking string width) */ font_width_max = (10 * UI_DPI_FAC) / xscale; @@ -487,7 +488,7 @@ void ED_markers_draw(const bContext *C, int flag) } } - glScalef(xscale, 1.0f, 1.0f); + gpuPopMatrix(); } /* ************************ Marker Wrappers API ********************* */ |