diff options
Diffstat (limited to 'source/blender/editors/util/ed_util.c')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index aa0d0faf4f5..490683e9360 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -318,13 +318,7 @@ void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *ar, void *arg_info const float mval_dst[2] = {win->eventstate->x - ar->winrct.xmin, win->eventstate->y - ar->winrct.ymin}; - VertexFormat *format = immVertexFormat(); - uint shdr_dashed_pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); - uint shdr_dashed_origin = VertexFormat_add_attrib(format, "line_origin", COMP_F32, 2, KEEP_FLOAT); - float color1[4]; - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + const uint shdr_pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_COLOR); @@ -332,21 +326,17 @@ void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *ar, void *arg_info glGetFloatv(GL_VIEWPORT, viewport_size); immUniform2f("viewport_size", viewport_size[2] / UI_DPI_FAC, viewport_size[3] / UI_DPI_FAC); - UI_GetThemeColor4fv(TH_VIEW_OVERLAY, color1); - immUniform4fv("color1", color1); - immUniform4f("color2", 0.0f, 0.0f, 0.0f, 0.0f); + immUniform1i("num_colors", 0); /* "simple" mode */ + immUniformThemeColor(TH_VIEW_OVERLAY); immUniform1f("dash_width", 6.0f); - immUniform1f("dash_width_on", 3.0f); + immUniform1f("dash_factor", 0.5f); immBegin(PRIM_LINES, 2); - immAttrib2fv(shdr_dashed_origin, mval_src); - immVertex2fv(shdr_dashed_pos, mval_src); - immVertex2fv(shdr_dashed_pos, mval_dst); + immVertex2fv(shdr_pos, mval_src); + immVertex2fv(shdr_pos, mval_dst); immEnd(); immUnbindProgram(); - - glDisable(GL_BLEND); } /** |