diff options
Diffstat (limited to 'source/blender/editors/manipulator_library')
7 files changed, 43 insertions, 43 deletions
diff --git a/source/blender/editors/manipulator_library/arrow2d_manipulator.c b/source/blender/editors/manipulator_library/arrow2d_manipulator.c index 5e7975d05e3..6e263b86bfa 100644 --- a/source/blender/editors/manipulator_library/arrow2d_manipulator.c +++ b/source/blender/editors/manipulator_library/arrow2d_manipulator.c @@ -75,7 +75,7 @@ static void arrow2d_draw_geom(ArrowManipulator2D *arrow, const float matrix[4][4 const float len = arrow->line_len; const float draw_line_ofs = (arrow->manipulator.line_width * 0.5f) / arrow->manipulator.scale; - uint pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); gpuPushMatrix(); gpuMultMatrix(matrix); @@ -90,12 +90,12 @@ static void arrow2d_draw_geom(ArrowManipulator2D *arrow, const float matrix[4][4 immUniformColor4fv(color); - immBegin(PRIM_LINES, 2); + immBegin(GWN_PRIM_LINES, 2); immVertex2f(pos, 0.0f, 0.0f); immVertex2f(pos, 0.0f, len); immEnd(); - immBegin(PRIM_TRIANGLES, 3); + immBegin(GWN_PRIM_TRIS, 3); immVertex2f(pos, size_h, len); immVertex2f(pos, -size_h, len); immVertex2f(pos, 0.0f, len + size * 1.7f); diff --git a/source/blender/editors/manipulator_library/arrow3d_manipulator.c b/source/blender/editors/manipulator_library/arrow3d_manipulator.c index 41368240f46..6e7fa3a7269 100644 --- a/source/blender/editors/manipulator_library/arrow3d_manipulator.c +++ b/source/blender/editors/manipulator_library/arrow3d_manipulator.c @@ -101,7 +101,7 @@ static void manipulator_arrow_matrix_world_get(wmManipulator *mpr, float r_matri static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select, const float color[4]) { - uint pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); bool unbind_shader = true; immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); @@ -109,7 +109,7 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select, if (arrow->style & ED_MANIPULATOR_ARROW_STYLE_CROSS) { immUniformColor4fv(color); - immBegin(PRIM_LINES, 4); + immBegin(GWN_PRIM_LINES, 4); immVertex3f(pos, -1.0f, 0.0f, 0.0f); immVertex3f(pos, 1.0f, 0.0f, 0.0f); immVertex3f(pos, 0.0f, -1.0f, 0.0f); @@ -127,7 +127,7 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select, }; glLineWidth(arrow->manipulator.line_width); - wm_manipulator_vec_draw(color, vec, ARRAY_SIZE(vec), pos, PRIM_LINE_LOOP); + wm_manipulator_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GWN_PRIM_LINE_LOOP); } else { #ifdef USE_MANIPULATOR_CUSTOM_ARROWS @@ -140,7 +140,7 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select, }; glLineWidth(arrow->manipulator.line_width); - wm_manipulator_vec_draw(color, vec, ARRAY_SIZE(vec), pos, PRIM_LINE_STRIP); + wm_manipulator_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GWN_PRIM_LINE_STRIP); /* *** draw arrow head *** */ diff --git a/source/blender/editors/manipulator_library/cage2d_manipulator.c b/source/blender/editors/manipulator_library/cage2d_manipulator.c index bf6c23f98e7..07667c70bd4 100644 --- a/source/blender/editors/manipulator_library/cage2d_manipulator.c +++ b/source/blender/editors/manipulator_library/cage2d_manipulator.c @@ -86,12 +86,12 @@ typedef struct Cage2D { static void rect_transform_draw_corners( const rctf *r, const float offsetx, const float offsety, const float color[3]) { - uint pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3fv(color); - immBegin(PRIM_LINES, 16); + immBegin(GWN_PRIM_LINES, 16); immVertex2f(pos, r->xmin, r->ymin + offsety); immVertex2f(pos, r->xmin, r->ymin); @@ -175,14 +175,14 @@ static void rect_transform_draw_interaction( return; } - VertexFormat *format = immVertexFormat(); - uint pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); - uint color = VertexFormat_add_attrib(format, "color", COMP_F32, 3, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); glLineWidth(line_width + 3.0); - immBegin(PRIM_LINE_STRIP, 3); + immBegin(GWN_PRIM_LINE_STRIP, 3); immAttrib3f(color, 0.0f, 0.0f, 0.0f); immVertex2fv(pos, verts[0]); immVertex2fv(pos, verts[1]); @@ -191,7 +191,7 @@ static void rect_transform_draw_interaction( glLineWidth(line_width); - immBegin(PRIM_LINE_STRIP, 3); + immBegin(GWN_PRIM_LINE_STRIP, 3); immAttrib3fv(color, col); immVertex2fv(pos, verts[0]); immVertex2fv(pos, verts[1]); diff --git a/source/blender/editors/manipulator_library/dial3d_manipulator.c b/source/blender/editors/manipulator_library/dial3d_manipulator.c index 111ea04cd3b..753cd794fe1 100644 --- a/source/blender/editors/manipulator_library/dial3d_manipulator.c +++ b/source/blender/editors/manipulator_library/dial3d_manipulator.c @@ -130,8 +130,8 @@ static void dial_geom_draw( glLineWidth(dial->manipulator.line_width); - VertexFormat *format = immVertexFormat(); - uint pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); if (clip_plane) { immBindBuiltinProgram(GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR); @@ -168,13 +168,13 @@ static void dial_ghostarc_draw_helpline(const float angle, const float co_outer[ gpuPushMatrix(); gpuRotate3f(RAD2DEGF(angle), 0.0f, 0.0f, -1.0f); - uint pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4fv(col); - immBegin(PRIM_LINE_STRIP, 2); + immBegin(GWN_PRIM_LINE_STRIP, 2); immVertex3f(pos, 0.0f, 0.0f, 0.0f); immVertex3fv(pos, co_outer); immEnd(); @@ -189,8 +189,8 @@ static void dial_ghostarc_draw( { const float width_inner = DIAL_WIDTH - dial->manipulator.line_width * 0.5f / U.manipulator_size; - VertexFormat *format = immVertexFormat(); - uint pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4fv(color); imm_draw_disk_partial_fill( diff --git a/source/blender/editors/manipulator_library/grab3d_manipulator.c b/source/blender/editors/manipulator_library/grab3d_manipulator.c index c794c99160c..995ee4e97c4 100644 --- a/source/blender/editors/manipulator_library/grab3d_manipulator.c +++ b/source/blender/editors/manipulator_library/grab3d_manipulator.c @@ -96,8 +96,8 @@ static void grab_geom_draw( glLineWidth(grab3d->manipulator.line_width); - VertexFormat *format = immVertexFormat(); - uint pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); diff --git a/source/blender/editors/manipulator_library/manipulator_draw_utils.c b/source/blender/editors/manipulator_library/manipulator_draw_utils.c index cfa1bc38ed5..4bd7f74e6e5 100644 --- a/source/blender/editors/manipulator_library/manipulator_draw_utils.c +++ b/source/blender/editors/manipulator_library/manipulator_draw_utils.c @@ -64,52 +64,52 @@ void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const boo * So we don't need to re-created and discard it every time */ const bool use_lighting = true || (!select && ((U.manipulator_flag & USER_MANIPULATOR_SHADED) != 0)); - VertexBuffer *vbo; - ElementList *el; - Batch *batch; - ElementListBuilder elb = {0}; + Gwn_VertBuf *vbo; + Gwn_IndexBuf *el; + Gwn_Batch *batch; + Gwn_IndexBufBuilder elb = {0}; - VertexFormat format = {0}; - uint pos_id = VertexFormat_add_attrib(&format, "pos", COMP_F32, 3, KEEP_FLOAT); + Gwn_VertFormat format = {0}; + uint pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); uint nor_id; if (use_lighting) { - nor_id = VertexFormat_add_attrib(&format, "nor", COMP_I16, 3, NORMALIZE_INT_TO_FLOAT); + nor_id = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I16, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); } /* Elements */ - ElementListBuilder_init(&elb, PRIM_TRIANGLES, info->ntris, info->nverts); + GWN_indexbuf_init(&elb, GWN_PRIM_TRIS, info->ntris, info->nverts); for (int i = 0; i < info->ntris; ++i) { const unsigned short *idx = &info->indices[i * 3]; - add_triangle_vertices(&elb, idx[0], idx[1], idx[2]); + GWN_indexbuf_add_tri_verts(&elb, idx[0], idx[1], idx[2]); } - el = ElementList_build(&elb); + el = GWN_indexbuf_build(&elb); - vbo = VertexBuffer_create_with_format(&format); - VertexBuffer_allocate_data(vbo, info->nverts); + vbo = GWN_vertbuf_create_with_format(&format); + GWN_vertbuf_data_alloc(vbo, info->nverts); - VertexBuffer_fill_attrib(vbo, pos_id, info->verts); + GWN_vertbuf_attr_fill(vbo, pos_id, info->verts); if (use_lighting) { /* Normals are expected to be smooth. */ - VertexBuffer_fill_attrib(vbo, nor_id, info->normals); + GWN_vertbuf_attr_fill(vbo, nor_id, info->normals); } - batch = Batch_create(PRIM_TRIANGLES, vbo, el); + batch = GWN_batch_create(GWN_PRIM_TRIS, vbo, el); Batch_set_builtin_program(batch, GPU_SHADER_3D_UNIFORM_COLOR); - Batch_Uniform4fv(batch, "color", color); + GWN_batch_uniform_4fv(batch, "color", color); glEnable(GL_CULL_FACE); // glEnable(GL_DEPTH_TEST); - Batch_draw(batch); + GWN_batch_draw(batch); glDisable(GL_DEPTH_TEST); // glDisable(GL_CULL_FACE); - Batch_discard_all(batch); + GWN_batch_discard_all(batch); } void wm_manipulator_vec_draw( diff --git a/source/blender/editors/manipulator_library/primitive3d_manipulator.c b/source/blender/editors/manipulator_library/primitive3d_manipulator.c index ba728145163..75151830109 100644 --- a/source/blender/editors/manipulator_library/primitive3d_manipulator.c +++ b/source/blender/editors/manipulator_library/primitive3d_manipulator.c @@ -79,10 +79,10 @@ static void manipulator_primitive_draw_geom( } if (vert_count > 0) { - uint pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); - wm_manipulator_vec_draw(col_inner, verts, vert_count, pos, PRIM_TRIANGLE_FAN); - wm_manipulator_vec_draw(col_outer, verts, vert_count, pos, PRIM_LINE_LOOP); + wm_manipulator_vec_draw(col_inner, verts, vert_count, pos, GWN_PRIM_TRI_FAN); + wm_manipulator_vec_draw(col_outer, verts, vert_count, pos, GWN_PRIM_LINE_LOOP); immUnbindProgram(); } } |