diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-04-07 23:31:26 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-04-07 23:31:26 +0300 |
commit | bd3a1b9490d96ca00748f405037379b743744877 (patch) | |
tree | aed8ff42fb92cc78de6729cd6d90c3c5ee9ad8ca /source/blender/editors/space_view3d/drawobject.c | |
parent | c1dc078840541bd64f95fdeca52267c75a061e04 (diff) |
OpenGL: use PRIM instead of GL enum for immBegin
Getting ready for a Gawain API change...
Part of T49043
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 291592a0a4c..930df90b9cc 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -550,7 +550,7 @@ void drawaxes(const float viewmat_local[4][4], float size, char drawtype, const switch (drawtype) { case OB_PLAINAXES: - immBegin(GL_LINES, 6); + immBegin(PRIM_LINES, 6); for (axis = 0; axis < 3; axis++) { v1[axis] = size; v2[axis] = -size; @@ -564,7 +564,7 @@ void drawaxes(const float viewmat_local[4][4], float size, char drawtype, const break; case OB_SINGLE_ARROW: - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); /* in positive z direction only */ v1[2] = size; immVertex3fv(pos, v1); @@ -572,7 +572,7 @@ void drawaxes(const float viewmat_local[4][4], float size, char drawtype, const immEnd(); /* square pyramid */ - immBegin(GL_TRIANGLES, 12); + immBegin(PRIM_TRIANGLES, 12); v2[0] = size * 0.035f; v2[1] = size * 0.035f; v3[0] = size * -0.035f; v3[1] = size * 0.035f; @@ -622,7 +622,7 @@ void drawaxes(const float viewmat_local[4][4], float size, char drawtype, const for (axis = 0; axis < 3; axis++) { const int arrow_axis = (axis == 0) ? 1 : 0; - immBegin(GL_LINES, 6); + immBegin(PRIM_LINES, 6); v2[axis] = size; immVertex3fv(pos, v1); @@ -712,7 +712,7 @@ static void draw_empty_image(Object *ob, const short dflag, const unsigned char immUniform1f("alpha", ob_alpha); immUniform1i("image", 0); /* default GL_TEXTURE0 unit */ - immBegin(GL_TRIANGLE_FAN, 4); + immBegin(PRIM_TRIANGLE_FAN, 4); immAttrib2f(texCoord, 0.0f, 0.0f); immVertex2f(pos, left, bottom); @@ -785,7 +785,7 @@ void imm_drawcircball(const float cent[3], float rad, const float tmat[4][4], un circball_array_fill(verts, cent, rad, tmat); - immBegin(GL_LINE_LOOP, CIRCLE_RESOL); + immBegin(PRIM_LINE_LOOP, CIRCLE_RESOL); for (int i = 0; i < CIRCLE_RESOL; ++i) { immVertex3fv(pos, verts[i]); } @@ -826,7 +826,7 @@ static void drawcentercircle(View3D *v3d, RegionView3D *UNUSED(rv3d), const floa immUniform4fv("outlineColor", outlineColor); immUniform1f("outlineWidth", outlineWidth); - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); immVertex3fv(pos, co); immEnd(); @@ -1020,7 +1020,7 @@ static void drawcube_size(float size, unsigned pos) glDrawRangeElements(GL_LINES, 0, 7, 24, GL_UNSIGNED_BYTE, indices); glDisableClientState(GL_VERTEX_ARRAY); #else - immBegin(GL_LINES, 24); + immBegin(PRIM_LINES, 24); for (int i = 0; i < 24; ++i) { immVertex3fv(pos, verts[indices[i]]); } @@ -1038,13 +1038,13 @@ static void drawshadbuflimits(const Lamp *la, const float mat[4][4], unsigned po madd_v3_v3v3fl(sta, mat[3], lavec, la->clipsta); madd_v3_v3v3fl(end, mat[3], lavec, la->clipend); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex3fv(pos, sta); immVertex3fv(pos, end); immEnd(); glPointSize(3.0f); - immBegin(GL_POINTS, 2); + immBegin(PRIM_POINTS, 2); immVertex3fv(pos, sta); immVertex3fv(pos, end); immEnd(); @@ -1119,7 +1119,7 @@ static void draw_spot_cone(Lamp *la, float x, float z, unsigned pos) const bool square = (la->mode & LA_SQUARE); - immBegin(GL_TRIANGLE_FAN, square ? 6 : 34); + immBegin(PRIM_TRIANGLE_FAN, square ? 6 : 34); immVertex3f(pos, 0.0f, 0.0f, -x); if (square) { @@ -1310,7 +1310,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, immUniformColor3fvAlpha(color, 0.3f); immUniform4fv("outlineColor", color); - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); immVertex3fv(pos, vec); immEnd(); @@ -1326,7 +1326,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, /* color doesn't matter, so don't set */ glPointSize(lampdot_size); - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); immVertex3fv(pos, vec); immEnd(); @@ -1381,7 +1381,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, setlinestyle(3); - immBegin(GL_LINES, 16); + immBegin(PRIM_LINES, 16); for (axis = 0; axis < 8; axis++) { immVertex3fv(pos, v1); immVertex3fv(pos, v2); @@ -1434,7 +1434,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, {-z_abs, z_abs, x}, }; - immBegin(GL_LINES, 16); + immBegin(PRIM_LINES, 16); for (int i = 1; i <= 4; ++i) { immVertex3fv(pos, vertices[0]); /* apex to corner */ immVertex3fv(pos, vertices[i]); @@ -1460,7 +1460,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, } else { /* draw the angled sides of the cone */ - immBegin(GL_LINE_STRIP, 3); + immBegin(PRIM_LINE_STRIP, 3); immVertex3fv(pos, vvec); immVertex3fv(pos, vec); immVertex3fv(pos, lvec); @@ -1488,7 +1488,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, /* draw clip start, useful for wide cones where its not obvious where the start is */ gpuTranslate3f(0.0f, 0.0f, -x); /* reverse translation above */ - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); if (la->type == LA_SPOT && (la->mode & LA_SHAD_BUF)) { float lvec_clip[3]; float vvec_clip[3]; @@ -1509,7 +1509,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, } else if (ELEM(la->type, LA_HEMI, LA_SUN)) { /* draw the line from the circle along the dist */ - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); vec[2] = -circrad; immVertex3fv(pos, vec); vec[2] = -la->dist; @@ -1529,7 +1529,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, float v[3] = {0.0f, 0.0f, 0.0f}; zdist = 0.02f; - immBegin(GL_LINE_STRIP, 6); + immBegin(PRIM_LINE_STRIP, 6); for (steps = 0; steps < 6; steps++) { if (axis == 0 || axis == 1) { /* x axis up, x axis down */ @@ -1568,7 +1568,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, else if (la->area_shape == LA_AREA_RECT) imm_draw_line_box_3d(pos, -la->area_size * 0.5f, -la->area_sizey * 0.5f, la->area_size * 0.5f, la->area_sizey * 0.5f); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex3f(pos, 0.0f, 0.0f, -circrad); immVertex3f(pos, 0.0f, 0.0f, -la->dist); immEnd(); @@ -1594,14 +1594,14 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, if (vec[2] > 0) vec[2] -= circrad; else vec[2] += circrad; - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex3fv(pos, vec); vec[2] = 0; immVertex3fv(pos, vec); immEnd(); glPointSize(2.0f); - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); immVertex3fv(pos, vec); immEnd(); @@ -1613,7 +1613,7 @@ void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, static void draw_limit_line(float sta, float end, const short dflag, const unsigned char col[3], unsigned pos) { - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex3f(pos, 0.0f, 0.0f, -sta); immVertex3f(pos, 0.0f, 0.0f, -end); immEnd(); @@ -1622,7 +1622,7 @@ static void draw_limit_line(float sta, float end, const short dflag, const unsig glPointSize(3.0f); /* would like smooth round points here, but that means binding another shader... * if it's really desired, pull these points into their own function to be called after */ - immBegin(GL_POINTS, 2); + immBegin(PRIM_POINTS, 2); if ((dflag & DRAW_CONSTCOLOR) == 0) { immUniformColor3ubv(col); } @@ -1637,7 +1637,7 @@ static void draw_limit_line(float sta, float end, const short dflag, const unsig /* qdn: now also enabled for Blender to set focus point for defocus composite node */ static void draw_focus_cross(float dist, float size, unsigned pos) { - immBegin(GL_LINES, 4); + immBegin(PRIM_LINES, 4); immVertex3f(pos, -size, 0.0f, -dist); immVertex3f(pos, size, 0.0f, -dist); immVertex3f(pos, 0.0f, -size, -dist); @@ -1823,7 +1823,7 @@ static void draw_viewport_object_reconstruction( glLineWidth(2.0f); - immBegin(GL_LINE_STRIP, reconstruction->camnr); + immBegin(PRIM_LINE_STRIP, reconstruction->camnr); for (int a = 0; a < reconstruction->camnr; a++, camera++) { immVertex3fv(pos, camera->mat[3]); } @@ -1887,7 +1887,7 @@ static void drawcamera_frame(float vec[4][3], bool filled, unsigned pos) /* center point to camera frame */ static void drawcamera_framelines(float vec[4][3], float origin[3], unsigned pos) { - immBegin(GL_LINES, 8); + immBegin(PRIM_LINES, 8); immVertex3fv(pos, origin); immVertex3fv(pos, vec[0]); immVertex3fv(pos, origin); @@ -1928,7 +1928,7 @@ static void drawcamera_volume(float near_plane[4][3], float far_plane[4][3], boo immEnd(); } else { - immBegin(GL_LINES, 8); + immBegin(PRIM_LINES, 8); for (int i = 0; i < 4; ++i) { immVertex3fv(pos, near_plane[i]); immVertex3fv(pos, far_plane[i]); @@ -2012,7 +2012,7 @@ static void drawcamera_stereo3d( glLineStipple(2, 0xAAAA); glEnable(GL_LINE_STIPPLE); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex3fv(pos, origin[0]); immVertex3fv(pos, origin[1]); immEnd(); @@ -2213,10 +2213,10 @@ void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, * for active cameras. We actually draw both outline+filled * for active cameras so the wire can be seen side-on */ for (int i = 0; i < 2; i++) { - if (i == 0) immBegin(GL_LINE_LOOP, 3); + if (i == 0) immBegin(PRIM_LINE_LOOP, 3); else if (i == 1 && is_active) { glDisable(GL_CULL_FACE); /* TODO: declarative state tracking */ - immBegin(GL_TRIANGLES, 3); + immBegin(PRIM_TRIANGLES, 3); } else break; @@ -2292,7 +2292,7 @@ void drawspeaker(const unsigned char ob_wire_col[3]) for (int j = 0; j < 3; j++) { float z = 0.25f * j - 0.125f; - immBegin(GL_LINE_LOOP, segments); + immBegin(PRIM_LINE_LOOP, segments); for (int i = 0; i < segments; i++) { float x = cosf((float)M_PI * i / 8.0f) * (j == 0 ? 0.5f : 0.25f); float y = sinf((float)M_PI * i / 8.0f) * (j == 0 ? 0.5f : 0.25f); @@ -2304,7 +2304,7 @@ void drawspeaker(const unsigned char ob_wire_col[3]) for (int j = 0; j < 4; j++) { float x = (((j + 1) % 2) * (j - 1)) * 0.5f; float y = ((j % 2) * (j - 2)) * 0.5f; - immBegin(GL_LINE_STRIP, 3); + immBegin(PRIM_LINE_STRIP, 3); for (int i = 0; i < 3; i++) { if (i == 1) { x *= 0.5f; @@ -2331,7 +2331,7 @@ static void lattice_draw_verts(Lattice *lt, DispList *dl, BPoint *actbp, short s UI_GetThemeColor4fv(TH_ACTIVE_VERT, active_color); glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); - immBeginAtMost(GL_POINTS, lt->pntsw * lt->pntsv * lt->pntsu); + immBeginAtMost(PRIM_POINTS, lt->pntsw * lt->pntsv * lt->pntsu); for (int w = 0; w < lt->pntsw; w++) { int wxt = (w == 0 || w == lt->pntsw - 1); @@ -2465,7 +2465,7 @@ static void drawlattice(View3D *v3d, Object *ob, const short dflag, const unsign } glLineWidth(1.0f); - immBeginAtMost(GL_LINES, lt->pntsw * lt->pntsv * lt->pntsu * 6); + immBeginAtMost(PRIM_LINES, lt->pntsw * lt->pntsv * lt->pntsu * 6); for (w = 0; w < lt->pntsw; w++) { int wxt = (w == 0 || w == lt->pntsw - 1); @@ -2567,7 +2567,7 @@ static void drawSelectedVertices(DerivedMesh *dm, Mesh *me) immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); - immBeginAtMost(GL_POINTS, dm->getNumVerts(dm)); + immBeginAtMost(PRIM_POINTS, dm->getNumVerts(dm)); dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, &data, DM_FOREACH_NOP); immEnd(); @@ -2641,7 +2641,7 @@ static void draw_dm_face_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformThemeColor(theme_id); - immBeginAtMost(GL_LINES, dm->getNumPolys(dm) * 2); + immBeginAtMost(PRIM_LINES, dm->getNumPolys(dm) * 2); dm->foreachMappedFaceCenter(dm, draw_dm_face_normals__mapFunc, &data, DM_FOREACH_USE_NORMAL); immEnd(); @@ -2673,7 +2673,7 @@ static void draw_dm_face_centers(BMEditMesh *em, DerivedMesh *dm, bool select, c immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor3ubv(fcol); - immBeginAtMost(GL_POINTS, dm->getNumPolys(dm)); + immBeginAtMost(PRIM_POINTS, dm->getNumPolys(dm)); dm->foreachMappedFaceCenter(dm, draw_dm_face_centers__mapFunc, &data, DM_FOREACH_NOP); immEnd(); @@ -2727,7 +2727,7 @@ static void draw_dm_vert_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformThemeColor(theme_id); - immBeginAtMost(GL_LINES, dm->getNumVerts(dm) * 2); + immBeginAtMost(PRIM_LINES, dm->getNumVerts(dm) * 2); dm->foreachMappedVert(dm, draw_dm_vert_normals__mapFunc, &data, DM_FOREACH_USE_NORMAL); immEnd(); @@ -2801,7 +2801,7 @@ static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, const char sel, BMVer glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); - immBeginAtMost(GL_POINTS, dm->getNumVerts(dm)); + immBeginAtMost(PRIM_POINTS, dm->getNumVerts(dm)); dm->foreachMappedVert(dm, draw_dm_verts__mapFunc, &data, DM_FOREACH_NOP); immEnd(); @@ -3145,7 +3145,7 @@ static void draw_dm_loop_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv calcDrawDMNormalScale(ob, &data); - immBeginAtMost(GL_LINES, dm->getNumLoops(dm) * 2); + immBeginAtMost(PRIM_LINES, dm->getNumLoops(dm) * 2); dm->foreachMappedLoop(dm, draw_dm_loop_normals__mapFunc, &data, DM_FOREACH_USE_NORMAL); immEnd(); @@ -3323,7 +3323,7 @@ static void draw_dm_bweights(BMEditMesh *em, Scene *scene, DerivedMesh *dm) glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) + 2.0f); - immBeginAtMost(GL_POINTS, dm->getNumVerts(dm)); + immBeginAtMost(PRIM_POINTS, dm->getNumVerts(dm)); dm->foreachMappedVert(dm, draw_dm_bweights__mapFunc, &data, DM_FOREACH_NOP); immEnd(); @@ -6322,7 +6322,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv } if (count > 0) { - immBegin(GL_LINES, count * 2); + immBegin(PRIM_LINES, count * 2); for (a = 0, pa = psys->particles; a < totpart; a++, pa++) { for (i = 1; i < pa->totkey; ++i) { float v1[3], v2[3]; @@ -6359,7 +6359,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv else immUniformThemeColor(TH_WIRE); - immBegin(GL_LINES, 24); + immBegin(PRIM_LINES, 24); immVertex3f(pos_id, gmin[0], gmin[1], gmin[2]); immVertex3f(pos_id, gmax[0], gmin[1], gmin[2]); immVertex3f(pos_id, gmax[0], gmin[1], gmin[2]); immVertex3f(pos_id, gmax[0], gmax[1], gmin[2]); immVertex3f(pos_id, gmax[0], gmax[1], gmin[2]); immVertex3f(pos_id, gmin[0], gmax[1], gmin[2]); @@ -6388,7 +6388,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if (count >= 2) { glEnable(GL_BLEND); - immBegin(GL_LINES, count); + immBegin(PRIM_LINES, count); for (i = 1; i < res[0] - 1; ++i) { float f = interpf(gmax[0], gmin[0], (float)i / (float)(res[0] - 1)); immVertex3f(pos_id, f, gmin[1], gmin[2]); immVertex3f(pos_id, f, gmax[1], gmin[2]); @@ -6705,7 +6705,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) unsigned int pos_id = VertexFormat_add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); unsigned int col_id = VertexFormat_add_attrib(format, "color", COMP_F32, 3, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); - immBeginAtMost(GL_POINTS, totpoint); + immBeginAtMost(PRIM_POINTS, totpoint); for (i = 0, point = edit->points; i < totpoint; i++, point++) { if ((point->flag & PEP_HIDE) == 0 && point->totkey) { PTCacheEditKey *key = point->keys + point->totkey - 1; @@ -6742,7 +6742,7 @@ static void ob_draw_RE_motion(float com[3], float rotscale[3][3], float itw, flo unsigned int col = VertexFormat_add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); - immBegin(GL_LINES, 30); + immBegin(PRIM_LINES, 30); immAttrib4ub(col, 0x7F, 0x00, 0x00, 155); root[1] = root[2] = 0.0f; @@ -6896,7 +6896,7 @@ static void drawhandlesN(Nurb *nu, const char sel, const bool hide_handles) glLineWidth(1.0f); - immBeginAtMost(GL_LINES, nu->pntsu * 4); + immBeginAtMost(PRIM_LINES, nu->pntsu * 4); BezTriple *bezt = nu->bezt; int a = nu->pntsu; @@ -6950,7 +6950,7 @@ static void drawhandlesN_active(Nurb *nu) immUniformThemeColor(TH_ACTIVE_SPLINE); glLineWidth(2.0f); - immBeginAtMost(GL_LINES, nu->pntsu * 4); + immBeginAtMost(PRIM_LINES, nu->pntsu * 4); BezTriple *bezt = nu->bezt; int a = nu->pntsu; while (a--) { @@ -7002,7 +7002,7 @@ static void drawvertsN(const Nurb *nurb, const bool hide_handles, const void *ve glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); - immBeginAtMost(GL_POINTS, count); + immBeginAtMost(PRIM_POINTS, count); for (nu = nurb; nu; nu = nu->next) { @@ -7072,8 +7072,8 @@ static void editnurb_draw_active_poly(Nurb *nu) BPoint *bp = nu->bp; for (int b = 0; b < nu->pntsv; b++) { if (nu->pntsu >= 2) { - if (nu->flagu & 1) immBegin(GL_LINE_LOOP, nu->pntsu); - else immBegin(GL_LINE_STRIP, nu->pntsu); + if (nu->flagu & 1) immBegin(PRIM_LINE_LOOP, nu->pntsu); + else immBegin(PRIM_LINE_STRIP, nu->pntsu); for (int a = 0; a < nu->pntsu; a++, bp++) { immVertex3fv(pos, bp->vec); @@ -7100,7 +7100,7 @@ static void editnurb_draw_active_nurbs(Nurb *nu) if (nu->pntsv > 1) count += (nu->pntsv - 1) * nu->pntsu * 2; if (count < 2) return; - immBeginAtMost(GL_LINES, count); + immBeginAtMost(PRIM_LINES, count); BPoint *bp = nu->bp; for (int b = 0; b < nu->pntsv; b++) { BPoint *bp1 = bp; @@ -7167,8 +7167,8 @@ static void draw_editnurb_splines(Object *ob, Nurb *nurb, const bool sel) bp = nu->bp; for (b = 0; b < nu->pntsv; b++) { if (nu->pntsu >= 2) { - if (nu->flagu & 1) immBegin(GL_LINE_LOOP, nu->pntsu); - else immBegin(GL_LINE_STRIP, nu->pntsu); + if (nu->flagu & 1) immBegin(PRIM_LINE_LOOP, nu->pntsu); + else immBegin(PRIM_LINE_STRIP, nu->pntsu); for (a = 0; a < nu->pntsu; a++, bp++) { immVertex3fv(pos, bp->vec); @@ -7199,7 +7199,7 @@ static void draw_editnurb_splines(Object *ob, Nurb *nurb, const bool sel) glLineWidth(1.0f); - immBeginAtMost(GL_LINES, count); + immBeginAtMost(PRIM_LINES, count); bp = nu->bp; for (b = 0; b < nu->pntsv; b++) { @@ -7341,7 +7341,7 @@ static void draw_editnurb( } if (count > 2) { - immBegin(GL_LINES, count); + immBegin(PRIM_LINES, count); for (bl = ob->curve_cache->bev.first, nu = nurb; nu && bl; bl = bl->next, nu = nu->next) { BevPoint *bevp = bl->bevpoints; int nr = bl->nr; @@ -7396,7 +7396,7 @@ static void draw_editfont_textcurs(RegionView3D *rv3d, float textcurs[4][2]) set_inverted_drawing(1); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); imm_cpack(0); - immBegin(GL_TRIANGLE_FAN, 4); + immBegin(PRIM_TRIANGLE_FAN, 4); immVertex2fv(pos, textcurs[0]); immVertex2fv(pos, textcurs[1]); immVertex2fv(pos, textcurs[2]); @@ -7439,7 +7439,7 @@ static void draw_editfont(Scene *scene, SceneLayer *sl, View3D *v3d, RegionView3 vec1[1] += cu->linedist * cu->fsize; vec2[1] -= cu->lines * cu->linedist * cu->fsize; setlinestyle(3); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex2fv(pos, vec1); immVertex2fv(pos, vec2); immEnd(); @@ -7456,7 +7456,7 @@ static void draw_editfont(Scene *scene, SceneLayer *sl, View3D *v3d, RegionView3 vec1[0] = cu->xof + cu->tb[i].x; vec1[1] = cu->yof + cu->tb[i].y + cu->fsize; vec1[2] = 0.001; - immBegin(GL_LINE_STRIP, 5); + immBegin(PRIM_LINE_STRIP, 5); immVertex3fv(pos, vec1); vec1[0] += cu->tb[i].w; immVertex3fv(pos, vec1); @@ -7498,7 +7498,7 @@ static void draw_editfont(Scene *scene, SceneLayer *sl, View3D *v3d, RegionView3 /* fill in xy below */ tvec[2] = 0.001; - immBegin(GL_TRIANGLE_FAN, 4); + immBegin(PRIM_TRIANGLE_FAN, 4); if (sb->rot == 0.0f) { copy_v2_fl2(tvec, sb->x, sb->y); @@ -7556,15 +7556,15 @@ static void draw_empty_sphere(float size, unsigned pos) p[i][1] = size * sinf(angle); } - immBegin(GL_LINE_LOOP, NSEGMENTS); + immBegin(PRIM_LINE_LOOP, NSEGMENTS); for (int i = 0; i < NSEGMENTS; ++i) immVertex3f(pos, p[i][0], p[i][1], 0.0f); immEnd(); - immBegin(GL_LINE_LOOP, NSEGMENTS); + immBegin(PRIM_LINE_LOOP, NSEGMENTS); for (int i = 0; i < NSEGMENTS; ++i) immVertex3f(pos, p[i][0], 0.0f, p[i][1]); immEnd(); - immBegin(GL_LINE_LOOP, NSEGMENTS); + immBegin(PRIM_LINE_LOOP, NSEGMENTS); for (int i = 0; i < NSEGMENTS; ++i) immVertex3f(pos, 0.0f, p[i][0], p[i][1]); immEnd(); @@ -7584,7 +7584,7 @@ static void draw_empty_cone(float size, unsigned pos) } /* cone sides */ - immBegin(GL_LINES, NSEGMENTS * 2); + immBegin(PRIM_LINES, NSEGMENTS * 2); for (int i = 0; i < NSEGMENTS; ++i) { immVertex3f(pos, 0.0f, 2.0f * size, 0.0f); immVertex3f(pos, p[i][0], 0.0f, p[i][1]); @@ -7592,7 +7592,7 @@ static void draw_empty_cone(float size, unsigned pos) immEnd(); /* end ring */ - immBegin(GL_LINE_LOOP, NSEGMENTS); + immBegin(PRIM_LINE_LOOP, NSEGMENTS); for (int i = 0; i < NSEGMENTS; ++i) immVertex3f(pos, p[i][0], 0.0f, p[i][1]); immEnd(); @@ -7615,7 +7615,7 @@ static void drawspiral(unsigned int pos, const float cent[3], float rad, float t mul_v3_v3fl(vx, tmat[0], rad); mul_v3_v3fl(vy, tmat[1], rad); - immBegin(GL_LINE_STRIP, CIRCLE_RESOL + 1); + immBegin(PRIM_LINE_STRIP, CIRCLE_RESOL + 1); if (inverse == 0) { copy_v3_v3(vec, cent); @@ -7669,7 +7669,7 @@ static void drawspiral(unsigned int pos, const float cent[3], float rad, float t * all required matrices have been set (used for drawing empties) */ static void drawcircle_size(float size, unsigned pos) { - immBegin(GL_LINE_LOOP, CIRCLE_RESOL); + immBegin(PRIM_LINE_LOOP, CIRCLE_RESOL); /* coordinates are: cos(degrees * 11.25) = x, sin(degrees * 11.25) = y, 0.0f = z */ for (short degrees = 0; degrees < CIRCLE_RESOL; degrees++) { @@ -7693,7 +7693,7 @@ static void imm_drawtube(const float vec[3], float radius, float height, float t imm_drawcircball(cur, radius, tmat, pos); - immBegin(GL_LINES, 8); + immBegin(PRIM_LINES, 8); immVertex3f(pos, vec[0] + radius, vec[1], vec[2]); immVertex3f(pos, cur[0] + radius, cur[1], cur[2]); immVertex3f(pos, vec[0] - radius, vec[1], vec[2]); @@ -7715,7 +7715,7 @@ static void imm_drawcone(const float vec[3], float radius, float height, float t imm_drawcircball(cur, radius, tmat, pos); - immBegin(GL_LINES, 8); + immBegin(PRIM_LINES, 8); immVertex3f(pos, vec[0], vec[1], vec[2]); immVertex3f(pos, cur[0] + radius, cur[1], cur[2]); immVertex3f(pos, vec[0], vec[1], vec[2]); @@ -8297,7 +8297,7 @@ static void draw_hooks(Object *ob, unsigned int pos) if (hmd->object) { setlinestyle(3); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex3fv(pos, hmd->object->obmat[3]); immVertex3fv(pos, vec); immEnd(); @@ -8305,7 +8305,7 @@ static void draw_hooks(Object *ob, unsigned int pos) } glPointSize(3.0f); - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); immVertex3fv(pos, vec); immEnd(); } @@ -8327,7 +8327,7 @@ static void draw_rigid_body_pivot(bRigidBodyJointConstraint *data, glLineWidth(4.0f); setlinestyle(2); - immBegin(GL_LINES, 6); + immBegin(PRIM_LINES, 6); for (int axis = 0; axis < 3; axis++) { float dir[3] = {0, 0, 0}; float v[3]; @@ -9127,7 +9127,7 @@ afterdraw: /* TODO: short term, use DEPTH_ONLY shader or set appropriate color */ /* TODO: long term, solve picking & selection problem better */ glPointSize(U.obcenter_dia); - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); immVertex3fv(pos, ob->obmat[3]); immEnd(); immUnbindProgram(); @@ -9162,7 +9162,7 @@ afterdraw: /* help lines and so */ if (ob != scene->obedit && ob->parent && (ob->parent->lay & v3d->lay)) { setlinestyle(3); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex3fv(pos, ob->obmat[3]); immVertex3fv(pos, ob->orig); immEnd(); @@ -9204,7 +9204,7 @@ afterdraw: if (camob) { setlinestyle(3); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex3fv(pos, camob->obmat[3]); immVertex3fv(pos, ob->obmat[3]); immEnd(); @@ -9228,7 +9228,7 @@ afterdraw: unit_m4(ct->matrix); setlinestyle(3); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex3fv(pos, ct->matrix[3]); immVertex3fv(pos, ob->obmat[3]); immEnd(); @@ -9248,7 +9248,7 @@ afterdraw: immUniformThemeColor(TH_WIRE); setlinestyle(3); - immBegin(GL_LINES, ((int)((bool)rbc->ob1) + (int)((bool)rbc->ob2)) * 2); + immBegin(PRIM_LINES, ((int)((bool)rbc->ob1) + (int)((bool)rbc->ob2)) * 2); if (rbc->ob1) { immVertex3fv(pos, ob->obmat[3]); immVertex3fv(pos, rbc->ob1->obmat[3]); @@ -9344,7 +9344,7 @@ static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset) glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); - immBeginAtMost(GL_POINTS, dm->getNumVerts(dm)); + immBeginAtMost(PRIM_POINTS, dm->getNumVerts(dm)); dm->foreachMappedVert(dm, bbs_obmode_mesh_verts__mapFunc, &data, DM_FOREACH_NOP); immEnd(); @@ -9377,7 +9377,7 @@ static void bbs_mesh_verts(BMEditMesh *em, DerivedMesh *dm, int offset) glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); - immBeginAtMost(GL_POINTS, em->bm->totvert); + immBeginAtMost(PRIM_POINTS, em->bm->totvert); dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, &data, DM_FOREACH_NOP); immEnd(); @@ -9467,7 +9467,7 @@ static void bbs_mesh_solid_EM(BMEditMesh *em, Scene *scene, View3D *v3d, glPointSize(UI_GetThemeValuef(TH_FACEDOT_SIZE)); - immBeginAtMost(GL_POINTS, em->bm->totface); + immBeginAtMost(PRIM_POINTS, em->bm->totface); dm->foreachMappedFaceCenter(dm, bbs_mesh_solid__drawCenter, &data, DM_FOREACH_NOP); immEnd(); |