From 54343b821d6bea408aa84a087e6e4f64ba460019 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 Jun 2016 07:39:12 +1000 Subject: GPU: use basic-shader for line-stipple --- source/blender/editors/sculpt_paint/paint_stroke.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 65857cccb15..67fbd000b64 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -58,6 +58,8 @@ #include "BIF_gl.h" #include "BIF_glutil.h" +#include "GPU_basic_shader.h" + #include "ED_screen.h" #include "ED_view3d.h" @@ -160,11 +162,11 @@ static void paint_draw_line_cursor(bContext *C, int x, int y, void *customdata) glEnable(GL_LINE_SMOOTH); glEnable(GL_BLEND); - glEnable(GL_LINE_STIPPLE); - glLineStipple(3, 0xAAAA); + GPU_basic_shader_bind_enable(GPU_SHADER_LINE | GPU_SHADER_STIPPLE); + GPU_basic_shader_line_stipple(3, 0xAAAA); + GPU_basic_shader_line_width(3.0); glColor4ub(0, 0, 0, paint->paint_cursor_col[3]); - glLineWidth(3.0); if (stroke->constrain_line) { sdrawline((int)stroke->last_mouse_position[0], (int)stroke->last_mouse_position[1], stroke->constrained_pos[0], stroke->constrained_pos[1]); @@ -175,7 +177,7 @@ static void paint_draw_line_cursor(bContext *C, int x, int y, void *customdata) } glColor4ub(255, 255, 255, paint->paint_cursor_col[3]); - glLineWidth(1.0); + GPU_basic_shader_line_width(1.0); if (stroke->constrain_line) { sdrawline((int)stroke->last_mouse_position[0], (int)stroke->last_mouse_position[1], stroke->constrained_pos[0], stroke->constrained_pos[1]); @@ -185,7 +187,7 @@ static void paint_draw_line_cursor(bContext *C, int x, int y, void *customdata) x, y); } - glDisable(GL_LINE_STIPPLE); + GPU_basic_shader_bind_disable(GPU_SHADER_LINE | GPU_SHADER_STIPPLE); glDisable(GL_BLEND); glDisable(GL_LINE_SMOOTH); -- cgit v1.2.3