[Bf-blender-cvs] [fe73b8c] blender2.8: use new enum types in glutil & imm_util
Mike Erwin
noreply at git.blender.org
Fri Nov 18 04:01:49 CET 2016
Commit: fe73b8c29cd2423350036c22d2b4fb5a0d363034
Author: Mike Erwin
Date: Thu Nov 17 16:10:53 2016 -0500
Branches: blender2.8
https://developer.blender.org/rBfe73b8c29cd2423350036c22d2b4fb5a0d363034
use new enum types in glutil & imm_util
===================================================================
M source/blender/editors/screen/glutil.c
M source/blender/gpu/gawain/imm_util.c
===================================================================
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index d719542..4759325 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -171,7 +171,7 @@ void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments
glEnd();
}
-static void imm_draw_circle(GLenum prim_type, unsigned pos, float x, float y, float rad, int nsegments)
+static void imm_draw_circle(PrimitiveType prim_type, unsigned pos, float x, float y, float rad, int nsegments)
{
immBegin(prim_type, nsegments);
for (int i = 0; i < nsegments; ++i) {
@@ -184,17 +184,17 @@ static void imm_draw_circle(GLenum prim_type, unsigned pos, float x, float y, fl
void imm_draw_lined_circle(unsigned pos, float x, float y, float rad, int nsegments)
{
- imm_draw_circle(GL_LINE_LOOP, pos, x, y, rad, nsegments);
+ imm_draw_circle(PRIM_LINE_LOOP, pos, x, y, rad, nsegments);
}
void imm_draw_filled_circle(unsigned pos, float x, float y, float rad, int nsegments)
{
- imm_draw_circle(GL_TRIANGLE_FAN, pos, x, y, rad, nsegments);
+ imm_draw_circle(PRIM_TRIANGLE_FAN, pos, x, y, rad, nsegments);
}
void imm_draw_lined_circle_3D(unsigned pos, float x, float y, float rad, int nsegments)
{
- immBegin(GL_LINE_LOOP, nsegments);
+ immBegin(PRIM_LINE_LOOP, nsegments);
for (int i = 0; i < nsegments; ++i) {
float angle = 2 * M_PI * ((float)i / (float)nsegments);
immVertex3f(pos, x + rad * cosf(angle),
@@ -205,7 +205,7 @@ void imm_draw_lined_circle_3D(unsigned pos, float x, float y, float rad, int nse
void imm_draw_line_box(unsigned pos, float x1, float y1, float x2, float y2)
{
- immBegin(GL_LINE_LOOP, 4);
+ immBegin(PRIM_LINE_LOOP, 4);
immVertex2f(pos, x1, y1);
immVertex2f(pos, x1, y2);
immVertex2f(pos, x2, y2);
@@ -216,7 +216,7 @@ void imm_draw_line_box(unsigned pos, float x1, float y1, float x2, float y2)
void imm_draw_line_box_3D(unsigned pos, float x1, float y1, float x2, float y2)
{
/* use this version when VertexFormat has a vec3 position */
- immBegin(GL_LINE_LOOP, 4);
+ immBegin(PRIM_LINE_LOOP, 4);
immVertex3f(pos, x1, y1, 0.0f);
immVertex3f(pos, x1, y2, 0.0f);
immVertex3f(pos, x2, y2, 0.0f);
diff --git a/source/blender/gpu/gawain/imm_util.c b/source/blender/gpu/gawain/imm_util.c
index 0f253fe..74caeb6 100644
--- a/source/blender/gpu/gawain/imm_util.c
+++ b/source/blender/gpu/gawain/imm_util.c
@@ -15,7 +15,7 @@
void immRectf(unsigned pos, float x1, float y1, float x2, float y2)
{
- immBegin(GL_TRIANGLE_FAN, 4);
+ immBegin(PRIM_TRIANGLE_FAN, 4);
immVertex2f(pos, x1, y1);
immVertex2f(pos, x2, y1);
immVertex2f(pos, x2, y2);
@@ -25,7 +25,7 @@ void immRectf(unsigned pos, float x1, float y1, float x2, float y2)
void immRecti(unsigned pos, int x1, int y1, int x2, int y2)
{
- immBegin(GL_TRIANGLE_FAN, 4);
+ immBegin(PRIM_TRIANGLE_FAN, 4);
immVertex2i(pos, x1, y1);
immVertex2i(pos, x2, y1);
immVertex2i(pos, x2, y2);
@@ -37,7 +37,7 @@ void immRecti(unsigned pos, int x1, int y1, int x2, int y2)
void immRecti_complete(int x1, int y1, int x2, int y2, const float color[4])
{
VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT);
+ unsigned pos = add_attrib(format, "pos", COMP_I32, 2, CONVERT_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4fv(color);
immRecti(pos, x1, y1, x2, y2);
More information about the Bf-blender-cvs
mailing list