Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2018-06-28 04:07:23 +0300
committerRay Molenkamp <github@lazydodo.com>2018-06-28 04:07:23 +0300
commit8e02106d0ddc7b31844d26037a824d56d3c65663 (patch)
treebfa1898220d74ac9610b8a1363a4087a44f7b41d /source/blender/editors/space_graph/space_graph.c
parentfe258fd4451a7fb1ccdd85d1607b6dbd30442f28 (diff)
GLRefactor: partially remove gl calls from source/blender/editors.
This translates the gl calls to the new GPU_ wrappers from D3501. Given it's tedious and repetitive work, this patch does as much as it can with search + replace, the remainder of the gl calls will need to be manually dealt with on a case by case basis. This fixes 13 of the 28 failing editors when building without opengl. For the list of substitutions see D3502 Reviewers: brecht Differential Revision: https://developer.blender.org/D3502
Diffstat (limited to 'source/blender/editors/space_graph/space_graph.c')
-rw-r--r--source/blender/editors/space_graph/space_graph.c22
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);