[Bf-blender-cvs] [3cecf39] blender2.8: immediate mode: starting using new immUniformThemeColorBlendShade and more conversion
Dalai Felinto
noreply at git.blender.org
Thu Oct 13 22:09:21 CEST 2016
Commit: 3cecf3906947b461d75665c7d2e2ba5735dcf015
Author: Dalai Felinto
Date: Thu Oct 13 20:08:18 2016 +0000
Branches: blender2.8
https://developer.blender.org/rB3cecf3906947b461d75665c7d2e2ba5735dcf015
immediate mode: starting using new immUniformThemeColorBlendShade and more conversion
===================================================================
M source/blender/editors/space_view3d/view3d_draw_legacy.c
===================================================================
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 5fc22fa..bdc0775 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) {
More information about the Bf-blender-cvs
mailing list