diff options
Diffstat (limited to 'source/blender/editors/space_graph/space_graph.c')
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 7c3105843c5..878c4815f73 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -54,6 +54,8 @@ #include "ED_markers.h" #include "GPU_immediate.h" +#include "GPU_state.h" +#include "GPU_framebuffer.h" #include "WM_api.h" #include "WM_types.h" @@ -240,8 +242,8 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); + GPU_clear_color(col[0], col[1], col[2], 0.0); + GPU_clear(GPU_COLOR_BIT); UI_view2d_view_ortho(v2d); @@ -287,15 +289,15 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) /* Draw a green line to indicate the cursor value */ immUniformThemeColorShadeAlpha(TH_CFRAME, -10, -50); - glEnable(GL_BLEND); - glLineWidth(2.0); + GPU_blend(true); + GPU_line_width(2.0); immBegin(GWN_PRIM_LINES, 2); immVertex2f(pos, v2d->cur.xmin, y); immVertex2f(pos, v2d->cur.xmax, y); immEnd(); - glDisable(GL_BLEND); + GPU_blend(false); } /* current frame or vertical component of vertical component of the cursor */ @@ -305,15 +307,15 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) /* to help differentiate this from the current frame, draw slightly darker like the horizontal one */ immUniformThemeColorShadeAlpha(TH_CFRAME, -40, -50); - glEnable(GL_BLEND); - glLineWidth(2.0); + GPU_blend(true); + GPU_line_width(2.0); immBegin(GWN_PRIM_LINES, 2); immVertex2f(pos, x, v2d->cur.ymin); immVertex2f(pos, x, v2d->cur.ymax); immEnd(); - glDisable(GL_BLEND); + GPU_blend(false); } immUnbindProgram(); @@ -381,8 +383,8 @@ static void graph_channel_region_draw(const bContext *C, ARegion *ar) /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); + GPU_clear_color(col[0], col[1], col[2], 0.0); + GPU_clear(GPU_COLOR_BIT); UI_view2d_view_ortho(v2d); |