diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2016-10-13 23:08:18 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2016-10-13 23:08:52 +0300 |
commit | 3cecf3906947b461d75665c7d2e2ba5735dcf015 (patch) | |
tree | 7c4fdf2a6154005ad6c53c3d4aac9921f785eaff /source/blender/editors/space_view3d | |
parent | 05cf74622f6b50d92cf077dcfb9d5086f4018e50 (diff) |
immediate mode: starting using new immUniformThemeColorBlendShade and more conversion
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw_legacy.c | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index 5fc22fa4a76..bdc0775579b 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -900,30 +900,43 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) if (ca->dtx & CAM_DTX_CENTER) { float x3, y3; - UI_ThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25, 0); - x3 = x1 + 0.5f * (x2 - x1); y3 = y1 + 0.5f * (y2 - y1); - glBegin(GL_LINES); - glVertex2f(x1, y3); - glVertex2f(x2, y3); + VertexFormat *format = immVertexFormat(); + unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); - glVertex2f(x3, y1); - glVertex2f(x3, y2); - glEnd(); + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immUniformThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25f, 0); + immBegin(GL_LINES, 4); + + immVertex2f(pos, x1, y3); + immVertex2f(pos, x2, y3); + + immVertex2f(pos, x3, y1); + immVertex2f(pos, x3, y2); + + immEnd(); + immUnbindProgram(); } if (ca->dtx & CAM_DTX_CENTER_DIAG) { - UI_ThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25, 0); - glBegin(GL_LINES); - glVertex2f(x1, y1); - glVertex2f(x2, y2); + VertexFormat *format = immVertexFormat(); + unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); - glVertex2f(x1, y2); - glVertex2f(x2, y1); - glEnd(); + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immUniformThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25f, 0); + immBegin(GL_LINES, 4); + + immVertex2f(pos, x1, y1); + immVertex2f(pos, x2, y2); + + immVertex2f(pos, x1, y2); + immVertex2f(pos, x2, y1); + + immEnd(); + immUnbindProgram(); } if (ca->dtx & CAM_DTX_THIRDS) { |