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:
authorMike Erwin <significant.bit@gmail.com>2016-11-15 19:49:00 +0300
committerMike Erwin <significant.bit@gmail.com>2016-11-15 19:49:00 +0300
commitb78ddd43a5af7810b9befb1cdf2be0528c721932 (patch)
tree0d75f7d14d6b27af11b3365ab7313fea0418c872 /source/blender/editors
parent093b6c9e6e8eae7e1e559cf0742146f43525c84f (diff)
start using COMP_* instead of GL_* in viewport
Gawain can accept either enum, but its own COMP_ values are recommended.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c23
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c14
2 files changed, 17 insertions, 20 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index e843d3cdf8e..9184e4723a8 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -506,9 +506,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
y2i = (int)(y2 + (1.0f - 0.0001f));
/* use the same program for everything */
- VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
-
+ unsigned pos = add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
/* passepartout, specified in camera edit buttons */
@@ -707,8 +705,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
static void drawrenderborder(ARegion *ar, View3D *v3d)
{
/* use the same program for everything */
- VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
+ unsigned pos = add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
glLineWidth(1.0f);
@@ -802,8 +799,8 @@ static void view3d_draw_background_gradient()
glClear(GL_DEPTH_BUFFER_BIT);
VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
- unsigned color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 3, NORMALIZE_INT_TO_FLOAT);
+ unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
+ unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT);
unsigned char col_hi[3], col_lo[3];
immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
@@ -1112,8 +1109,8 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
#endif
VertexFormat* format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
- unsigned color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 3, NORMALIZE_INT_TO_FLOAT);
+ unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
+ unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
@@ -1288,8 +1285,8 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool wr
unsigned char col_bg[3], col_grid_emphasise[3], col_grid_light[3];
VertexFormat* format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
- unsigned color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 3, NORMALIZE_INT_TO_FLOAT);
+ unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
+ unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR);
@@ -1376,8 +1373,8 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool wr
/* draw axis lines -- sometimes grid floor is off, other times we still need to draw the Z axis */
VertexFormat* format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 3, KEEP_FLOAT);
- unsigned color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 3, NORMALIZE_INT_TO_FLOAT);
+ unsigned pos = add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT);
+ unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR);
immBegin(GL_LINES, (show_axis_x + show_axis_y + show_axis_z) * 2);
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 80428906c0a..86870d48e27 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -227,8 +227,8 @@ static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d)
glLineWidth(1);
VertexFormat* format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
- unsigned color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 3, NORMALIZE_INT_TO_FLOAT);
+ unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
+ unsigned color = add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
@@ -253,7 +253,7 @@ static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d)
immUnbindProgram();
VertexFormat_clear(format);
- pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
+ pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -312,8 +312,8 @@ static void draw_view_axis(RegionView3D *rv3d, rcti *rect)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
- unsigned col = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT);
+ unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
+ unsigned col = add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
immBegin(GL_LINES, 6);
@@ -360,8 +360,8 @@ static void draw_rotation_guide(RegionView3D *rv3d)
glDepthMask(0); /* don't overwrite zbuf */
VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 3, KEEP_FLOAT);
- unsigned col = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT);
+ unsigned pos = add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT);
+ unsigned col = add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_SMOOTH_COLOR);