OpenGL: remove glPointSize hack
authorMike Erwin <significant.bit@gmail.com>
Mon, 4 Jan 2016 08:30:18 +0000 (03:30 -0500)
committerMike Erwin <significant.bit@gmail.com>
Thu, 7 Jan 2016 21:32:35 +0000 (16:32 -0500)
source/blender/editors/include/BIF_glutil.h
source/blender/editors/interface/interface_draw.c
source/blender/editors/screen/glutil.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform.c
source/blender/editors/uvedit/uvedit_draw.c

index 05b733d25645dc20e607bef2b92b3f9e327d4bf8..98ee89ae38eb036229ba7323112591ab83261bc3 100644 (file)
@@ -185,13 +185,6 @@ void gla2DGetMap(gla2DDrawInfo *di, struct rctf *rect);
 void gla2DSetMap(gla2DDrawInfo *di, struct rctf *rect);
 #endif
 
-/* use this for platform hacks. glPointSize is solved here */
-void bglBegin(int mode);
-void bglEnd(void);
-// int bglPointHack(void); /* UNUSED */
-void bglVertex3fv(const float vec[3]);
-void bglVertex3f(float x, float y, float z);
-void bglVertex2fv(const float vec[2]);
 /* intel gfx cards frontbuffer problem */
 // void bglFlush(void); /* UNUSED */
 void set_inverted_drawing(int enable);
index a3adf65cd84c874073b70b39dffeede286eca351..e7f5f1b49de3f15c250e3e8b3717e136f509d740 100644 (file)
@@ -1506,7 +1506,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti
        /* the points, use aspect to make them visible on edges */
        cmp = cuma->curve;
        glPointSize(3.0f);
-       bglBegin(GL_POINTS);
+       glBegin(GL_POINTS);
        for (a = 0; a < cuma->totpoint; a++) {
                if (cmp[a].flag & CUMA_SELECT)
                        UI_ThemeColor(TH_TEXT_HI);
@@ -1514,9 +1514,9 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti
                        UI_ThemeColor(TH_TEXT);
                fac[0] = rect->xmin + zoomx * (cmp[a].x - offsx);
                fac[1] = rect->ymin + zoomy * (cmp[a].y - offsy);
-               bglVertex2fv(fac);
+               glVertex2fv(fac);
        }
-       bglEnd();
+       glEnd();
        glPointSize(1.0f);
        
        /* restore scissortest */
index 0b83bf993ae3bc7a6b03481df8a883fba4488c68..a870b108fad011da0ea8b581bc9820c71375d1c0 100644 (file)
@@ -730,101 +730,6 @@ void glaEnd2DDraw(gla2DDrawInfo *di)
 }
 #endif
 
-/* **************** GL_POINT hack ************************ */
-
-static int curmode = 0;
-static int pointhack = 0;
-static GLubyte Squaredot[16] = {0xff, 0xff, 0xff, 0xff,
-                                0xff, 0xff, 0xff, 0xff,
-                                0xff, 0xff, 0xff, 0xff,
-                                0xff, 0xff, 0xff, 0xff};
-
-void bglBegin(int mode)
-{
-       curmode = mode;
-       
-       if (mode == GL_POINTS) {
-               float value[4];
-               glGetFloatv(GL_POINT_SIZE_RANGE, value);
-               if (value[1] < 2.0f) {
-                       glGetFloatv(GL_POINT_SIZE, value);
-                       pointhack = iroundf(value[0]);
-                       if (pointhack > 4) pointhack = 4;
-               }
-               else {
-                       glBegin(mode);
-               }
-       }
-}
-
-#if 0 /* UNUSED */
-int bglPointHack(void)
-{
-       float value[4];
-       int pointhack_px;
-       glGetFloatv(GL_POINT_SIZE_RANGE, value);
-       if (value[1] < 2.0f) {
-               glGetFloatv(GL_POINT_SIZE, value);
-               pointhack_px = floorf(value[0] + 0.5f);
-               if (pointhack_px > 4) pointhack_px = 4;
-               return pointhack_px;
-       }
-       return 0;
-}
-#endif
-
-void bglVertex3fv(const float vec[3])
-{
-       switch (curmode) {
-               case GL_POINTS:
-                       if (pointhack) {
-                               glRasterPos3fv(vec);
-                               glBitmap(pointhack, pointhack, (float)pointhack / 2.0f, (float)pointhack / 2.0f, 0.0, 0.0, Squaredot);
-                       }
-                       else {
-                               glVertex3fv(vec);
-                       }
-                       break;
-       }
-}
-
-void bglVertex3f(float x, float y, float z)
-{
-       switch (curmode) {
-               case GL_POINTS:
-                       if (pointhack) {
-                               glRasterPos3f(x, y, z);
-                               glBitmap(pointhack, pointhack, (float)pointhack / 2.0f, (float)pointhack / 2.0f, 0.0, 0.0, Squaredot);
-                       }
-                       else {
-                               glVertex3f(x, y, z);
-                       }
-                       break;
-       }
-}
-
-void bglVertex2fv(const float vec[2])
-{
-       switch (curmode) {
-               case GL_POINTS:
-                       if (pointhack) {
-                               glRasterPos2fv(vec);
-                               glBitmap(pointhack, pointhack, (float)pointhack / 2, pointhack / 2, 0.0, 0.0, Squaredot);
-                       }
-                       else {
-                               glVertex2fv(vec);
-                       }
-                       break;
-       }
-}
-
-
-void bglEnd(void)
-{
-       if (pointhack) pointhack = 0;
-       else glEnd();
-       
-}
 
 /* Uses current OpenGL state to get view matrices for gluProject/gluUnProject */
 void bgl_get_mats(bglMats *mats)
index 51865ebcf90be8b03540987b9503321ee8a29fc7..5e1747692e1b5209c7a0b1a680506a49a9836a53 100644 (file)
@@ -102,10 +102,7 @@ static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d)
        /* for now, point color is fixed, and is white */
        glColor3f(1.0f, 1.0f, 1.0f);
        
-       /* we use bgl points not standard gl points, to workaround vertex 
-        * drawing bugs that some drivers have (probably legacy ones only though)
-        */
-       bglBegin(GL_POINTS);
+       glBegin(GL_POINTS);
        for (i = 0, fed = env->data; i < env->totvert; i++, fed++) {
                /* only draw if visible
                 *      - min/max here are fixed, not relative
@@ -115,7 +112,7 @@ static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d)
                        glVertex2f(fed->time, fed->max);
                }
        }
-       bglEnd();  /* GL_POINTS */
+       glEnd();  /* GL_POINTS */
        
        glPointSize(1.0f);
 }
@@ -132,10 +129,7 @@ static void draw_fcurve_vertices_keyframes(FCurve *fcu, SpaceIpo *UNUSED(sipo),
        const float fac = 0.05f * BLI_rctf_size_x(&v2d->cur);
        int i;
        
-       /* we use bgl points not standard gl points, to workaround vertex 
-        * drawing bugs that some drivers have (probably legacy ones only though)
-        */
-       bglBegin(GL_POINTS);
+       glBegin(GL_POINTS);
        
        for (i = 0; i < fcu->totvert; i++, bezt++) {
                /* as an optimization step, only draw those in view 
@@ -148,17 +142,17 @@ static void draw_fcurve_vertices_keyframes(FCurve *fcu, SpaceIpo *UNUSED(sipo),
                                 *      - 
                                 */
                                if ((bezt->f2 & SELECT) == sel)
-                                       bglVertex3fv(bezt->vec[1]);
+                                       glVertex3fv(bezt->vec[1]);
                        }
                        else {
                                /* no check for selection here, as curve is not editable... */
                                /* XXX perhaps we don't want to even draw points?   maybe add an option for that later */
-                               bglVertex3fv(bezt->vec[1]);
+                               glVertex3fv(bezt->vec[1]);
                        }
                }
        }
        
-       bglEnd();  /* GL_POINTS */
+       glEnd();  /* GL_POINTS */
 }
 
 
index 3dd846803ee87de2fd4e58e58ae22a8d77247cc5..de79468d144719172a15b328c5f3f06165db3813 100644 (file)
@@ -968,10 +968,10 @@ static void drawshadbuflimits(Lamp *la, float mat[4][4])
        glEnd();
 
        glPointSize(3.0);
-       bglBegin(GL_POINTS);
-       bglVertex3fv(sta);
-       bglVertex3fv(end);
-       bglEnd();
+       glBegin(GL_POINTS);
+       glVertex3fv(sta);
+       glVertex3fv(end);
+       glEnd();
        glPointSize(1.0);
 }
 
@@ -2208,7 +2208,7 @@ static void lattice_draw_verts(Lattice *lt, DispList *dl, BPoint *actbp, short s
        UI_ThemeColor(color);
 
        glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
-       bglBegin(GL_POINTS);
+       glBegin(GL_POINTS);
 
        for (int w = 0; w < lt->pntsw; w++) {
                int wxt = (w == 0 || w == lt->pntsw - 1);
@@ -2221,11 +2221,11 @@ static void lattice_draw_verts(Lattice *lt, DispList *dl, BPoint *actbp, short s
                                                /* check for active BPoint and ensure selected */
                                                if ((bp == actbp) && (bp->f1 & SELECT)) {
                                                        UI_ThemeColor(TH_ACTIVE_VERT);
-                                                       bglVertex3fv(dl ? co : bp->vec);
+                                                       glVertex3fv(dl ? co : bp->vec);
                                                        UI_ThemeColor(color);
                                                }
                                                else if ((bp->f1 & SELECT) == sel) {
-                                                       bglVertex3fv(dl ? co : bp->vec);
+                                                       glVertex3fv(dl ? co : bp->vec);
                                                }
                                        }
                                }
@@ -2233,7 +2233,7 @@ static void lattice_draw_verts(Lattice *lt, DispList *dl, BPoint *actbp, short s
                }
        }
        
-       bglEnd();
+       glEnd();
        glPointSize(1.0);
 }
 
@@ -2487,16 +2487,16 @@ static void draw_dm_face_centers__mapFunc(void *userData, int index, const float
        if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) &&
            (BM_elem_flag_test(efa, BM_ELEM_SELECT) == data->select))
        {
-               bglVertex3fv(cent);
+               glVertex3fv(cent);
        }
 }
 static void draw_dm_face_centers(BMEditMesh *em, DerivedMesh *dm, bool select)
 {
        drawBMSelect_userData data = {em->bm, select};
 
-       bglBegin(GL_POINTS);
+       glBegin(GL_POINTS);
        dm->foreachMappedFaceCenter(dm, draw_dm_face_centers__mapFunc, &data, DM_FOREACH_NOP);
-       bglEnd();
+       glEnd();
 }
 
 static void draw_dm_vert_normals__mapFunc(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3])
@@ -2557,13 +2557,13 @@ static void draw_dm_verts__mapFunc(void *userData, int index, const float co[3],
                        const MVertSkin *vs = BM_ELEM_CD_GET_VOID_P(eve, data->cd_vskin_offset);
                        if (vs->flag & MVERT_SKIN_ROOT) {
                                float radius = (vs->radius[0] + vs->radius[1]) * 0.5f;
-                               bglEnd();
+                               glEnd();
                        
                                glColor4ubv(data->th_skin_root);
                                drawcircball(GL_LINES, co, radius, data->imat);
 
                                glColor4ubv(data->sel ? data->th_vertex_select : data->th_vertex);
-                               bglBegin(GL_POINTS);
+                               glBegin(GL_POINTS);
                        }
                }
 
@@ -2571,19 +2571,19 @@ static void draw_dm_verts__mapFunc(void *userData, int index, const float co[3],
                if (eve == data->eve_act) {
                        glColor4ubv(data->th_editmesh_active);
                        
-                       bglEnd();
+                       glEnd();
                        
                        glPointSize(data->th_vertex_size);
-                       bglBegin(GL_POINTS);
-                       bglVertex3fv(co);
-                       bglEnd();
+                       glBegin(GL_POINTS);
+                       glVertex3fv(co);
+                       glEnd();
 
                        glColor4ubv(data->sel ? data->th_vertex_select : data->th_vertex);
                        glPointSize(data->th_vertex_size);
-                       bglBegin(GL_POINTS);
+                       glBegin(GL_POINTS);
                }
                else {
-                       bglVertex3fv(co);
+                       glVertex3fv(co);
                }
        }
 }
@@ -2609,9 +2609,9 @@ static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, const char sel, BMVer
        mul_m4_m4m4(data.imat, rv3d->viewmat, em->ob->obmat);
        invert_m4(data.imat);
 
-       bglBegin(GL_POINTS);
+       glBegin(GL_POINTS);
        dm->foreachMappedVert(dm, draw_dm_verts__mapFunc, &data, DM_FOREACH_NOP);
-       bglEnd();
+       glEnd();
 }
 
 /* Draw edges with color set based on selection */
@@ -3083,7 +3083,7 @@ static void draw_dm_bweights__mapFunc(void *userData, int index, const float co[
                const float bweight = BM_ELEM_CD_GET_FLOAT(eve, data->cd_layer_offset);
                if (bweight != 0.0f) {
                        UI_ThemeColorBlend(TH_VERTEX, TH_VERTEX_SELECT, bweight);
-                       bglVertex3fv(co);
+                       glVertex3fv(co);
                }
        }
 }
@@ -3099,9 +3099,9 @@ static void draw_dm_bweights(BMEditMesh *em, Scene *scene, DerivedMesh *dm)
 
                if (data.cd_layer_offset != -1) {
                        glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) + 2);
-                       bglBegin(GL_POINTS);
+                       glBegin(GL_POINTS);
                        dm->foreachMappedVert(dm, draw_dm_bweights__mapFunc, &data, DM_FOREACH_NOP);
-                       bglEnd();
+                       glEnd();
                }
        }
        else {
@@ -6111,7 +6111,7 @@ static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, const
 
        glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
        
-       bglBegin(GL_POINTS);
+       glBegin(GL_POINTS);
        
        if (nu->type == CU_BEZIER) {
 
@@ -6122,21 +6122,21 @@ static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, const
                                if (sel == 1 && bezt == vert) {
                                        UI_ThemeColor(TH_ACTIVE_VERT);
 
-                                       if (bezt->f2 & SELECT) bglVertex3fv(bezt->vec[1]);
+                                       if (bezt->f2 & SELECT) glVertex3fv(bezt->vec[1]);
                                        if (!hide_handles) {
-                                               if (bezt->f1 & SELECT) bglVertex3fv(bezt->vec[0]);
-                                               if (bezt->f3 & SELECT) bglVertex3fv(bezt->vec[2]);
+                                               if (bezt->f1 & SELECT) glVertex3fv(bezt->vec[0]);
+                                               if (bezt->f3 & SELECT) glVertex3fv(bezt->vec[2]);
                                        }
 
                                        UI_ThemeColor(color);
                                }
                                else if (hide_handles) {
-                                       if ((bezt->f2 & SELECT) == sel) bglVertex3fv(bezt->vec[1]);
+                                       if ((bezt->f2 & SELECT) == sel) glVertex3fv(bezt->vec[1]);
                                }
                                else {
-                                       if ((bezt->f1 & SELECT) == sel) bglVertex3fv(bezt->vec[0]);
-                                       if ((bezt->f2 & SELECT) == sel) bglVertex3fv(bezt->vec[1]);
-                                       if ((bezt->f3 & SELECT) == sel) bglVertex3fv(bezt->vec[2]);
+                                       if ((bezt->f1 & SELECT) == sel) glVertex3fv(bezt->vec[0]);
+                                       if ((bezt->f2 & SELECT) == sel) glVertex3fv(bezt->vec[1]);
+                                       if ((bezt->f3 & SELECT) == sel) glVertex3fv(bezt->vec[2]);
                                }
                        }
                        bezt++;
@@ -6149,18 +6149,18 @@ static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, const
                        if (bp->hide == 0) {
                                if (bp == vert) {
                                        UI_ThemeColor(TH_ACTIVE_VERT);
-                                       bglVertex3fv(bp->vec);
+                                       glVertex3fv(bp->vec);
                                        UI_ThemeColor(color);
                                }
                                else {
-                                       if ((bp->f1 & SELECT) == sel) bglVertex3fv(bp->vec);
+                                       if ((bp->f1 & SELECT) == sel) glVertex3fv(bp->vec);
                                }
                        }
                        bp++;
                }
        }
        
-       bglEnd();
+       glEnd();
        glPointSize(1.0);
 }
 
@@ -7265,9 +7265,9 @@ static void draw_hooks(Object *ob)
                        }
 
                        glPointSize(3.0);
-                       bglBegin(GL_POINTS);
-                       bglVertex3fv(vec);
-                       bglEnd();
+                       glBegin(GL_POINTS);
+                       glVertex3fv(vec);
+                       glEnd();
                        glPointSize(1.0);
                }
        }
@@ -7851,14 +7851,14 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
                                
 
                                // glPointSize(3.0);
-                               bglBegin(GL_POINTS);
+                               glBegin(GL_POINTS);
 
                                for (i = 0; i < scs->numpoints; i++)
                                {
-                                       bglVertex3fv(&scs->points[3 * i]);
+                                       glVertex3fv(&scs->points[3 * i]);
                                }
 
-                               bglEnd();
+                               glEnd();
                                glPointSize(1.0);
 
                                glMultMatrixf(ob->obmat);
@@ -8185,7 +8185,7 @@ static void bbs_obmode_mesh_verts__mapFunc(void *userData, int index, const floa
 
        if (!(mv->flag & ME_HIDE)) {
                WM_framebuffer_index_set(data->offset + index);
-               bglVertex3fv(co);
+               glVertex3fv(co);
        }
 }
 
@@ -8197,9 +8197,9 @@ static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset)
        data.mvert = mvert;
        data.offset = offset;
        glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
-       bglBegin(GL_POINTS);
+       glBegin(GL_POINTS);
        dm->foreachMappedVert(dm, bbs_obmode_mesh_verts__mapFunc, &data, DM_FOREACH_NOP);
-       bglEnd();
+       glEnd();
        glPointSize(1.0);
 }
 
@@ -8211,16 +8211,16 @@ static void bbs_mesh_verts__mapFunc(void *userData, int index, const float co[3]
 
        if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
                WM_framebuffer_index_set(data->offset + index);
-               bglVertex3fv(co);
+               glVertex3fv(co);
        }
 }
 static void bbs_mesh_verts(BMEditMesh *em, DerivedMesh *dm, int offset)
 {
        drawBMOffset_userData data = {em->bm, offset};
        glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
-       bglBegin(GL_POINTS);
+       glBegin(GL_POINTS);
        dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, &data, DM_FOREACH_NOP);
-       bglEnd();
+       glEnd();
        glPointSize(1.0);
 }
 
@@ -8278,7 +8278,7 @@ static void bbs_mesh_solid__drawCenter(void *userData, int index, const float ce
        if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
                WM_framebuffer_index_set(index + 1);
 
-               bglVertex3fv(cent);
+               glVertex3fv(cent);
        }
 }
 
@@ -8294,9 +8294,9 @@ static void bbs_mesh_solid_EM(BMEditMesh *em, Scene *scene, View3D *v3d,
                if (check_ob_drawface_dot(scene, v3d, ob->dt)) {
                        glPointSize(UI_GetThemeValuef(TH_FACEDOT_SIZE));
 
-                       bglBegin(GL_POINTS);
+                       glBegin(GL_POINTS);
                        dm->foreachMappedFaceCenter(dm, bbs_mesh_solid__drawCenter, em->bm, DM_FOREACH_NOP);
-                       bglEnd();
+                       glEnd();
                }
 
        }
index bae57016eecd1db0d20e82b7b4d6fb9aaa5361ab..79c065de2f9e58d0f186afbb8480a40b73f872f5 100644 (file)
@@ -6825,25 +6825,25 @@ static void drawEdgeSlide(TransInfo *t)
 
                                UI_ThemeColorShadeAlpha(TH_SELECT, -30, alpha_shade);
                                glPointSize(ctrl_size);
-                               bglBegin(GL_POINTS);
+                               glBegin(GL_POINTS);
                                if (sld->flipped) {
-                                       if (curr_sv->v_side[1]) bglVertex3fv(curr_sv->v_side[1]->co);
+                                       if (curr_sv->v_side[1]) glVertex3fv(curr_sv->v_side[1]->co);
                                }
                                else {
-                                       if (curr_sv->v_side[0]) bglVertex3fv(curr_sv->v_side[0]->co);
+                                       if (curr_sv->v_side[0]) glVertex3fv(curr_sv->v_side[0]->co);
                                }
-                               bglEnd();
+                               glEnd();
 
                                UI_ThemeColorShadeAlpha(TH_SELECT, 255, alpha_shade);
                                glPointSize(guide_size);
-                               bglBegin(GL_POINTS);
+                               glBegin(GL_POINTS);
 #if 0
                                interp_v3_v3v3(co_mark, co_b, co_a, fac);
-                               bglVertex3fv(co_mark);
+                               glVertex3fv(co_mark);
 #endif
                                interp_line_v3_v3v3v3(co_mark, co_b, curr_sv->v_co_orig, co_a, fac);
-                               bglVertex3fv(co_mark);
-                               bglEnd();
+                               glVertex3fv(co_mark);
+                               glEnd();
                        }
                        else {
                                if (is_clamp == false) {
@@ -7436,15 +7436,15 @@ static void drawVertSlide(TransInfo *t)
                                        glVertex3fv(b);
                                }
                        }
-                       bglEnd();
+                       glEnd();
 
                        glPointSize(ctrl_size);
 
-                       bglBegin(GL_POINTS);
-                       bglVertex3fv((sld->flipped && sld->use_even) ?
-                                    curr_sv->co_link_orig_3d[curr_sv->co_link_curr] :
-                                    curr_sv->co_orig_3d);
-                       bglEnd();
+                       glBegin(GL_POINTS);
+                       glVertex3fv((sld->flipped && sld->use_even) ?
+                                   curr_sv->co_link_orig_3d[curr_sv->co_link_curr] :
+                                   curr_sv->co_orig_3d);
+                       glEnd();
 
                        glDisable(GL_BLEND);
 
index 34f59b56fffe69fa408b3524e3af50189687803a..9f9a42e9b807c30372b04d3861a2076f6d0f7c03 100644 (file)
@@ -861,32 +861,32 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                /* unselected faces */
                UI_ThemeColor(TH_WIRE);
 
-               bglBegin(GL_POINTS);
+               glBegin(GL_POINTS);
                BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
                        if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
                                continue;
 
                        if (!uvedit_face_select_test(scene, efa, cd_loop_uv_offset)) {
                                uv_poly_center(efa, cent, cd_loop_uv_offset);
-                               bglVertex2fv(cent);
+                               glVertex2fv(cent);
                        }
                }
-               bglEnd();
+               glEnd();
 
                /* selected faces */
                UI_ThemeColor(TH_FACE_DOT);
 
-               bglBegin(GL_POINTS);
+               glBegin(GL_POINTS);
                BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
                        if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
                                continue;
 
                        if (uvedit_face_select_test(scene, efa, cd_loop_uv_offset)) {
                                uv_poly_center(efa, cent, cd_loop_uv_offset);
-                               bglVertex2fv(cent);
+                               glVertex2fv(cent);
                        }
                }
-               bglEnd();
+               glEnd();
        }
 
        /* 6. draw uv vertices */
@@ -897,7 +897,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                pointsize = UI_GetThemeValuef(TH_VERTEX_SIZE);
                glPointSize(pointsize);
        
-               bglBegin(GL_POINTS);
+               glBegin(GL_POINTS);
                BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
                        if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
                                continue;
@@ -905,17 +905,17 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
                                if (!uvedit_uv_select_test(scene, l, cd_loop_uv_offset))
-                                       bglVertex2fv(luv->uv);
+                                       glVertex2fv(luv->uv);
                        }
                }
-               bglEnd();
+               glEnd();
        
                /* pinned uvs */
                /* give odd pointsizes odd pin pointsizes */
                glPointSize(pointsize * 2 + (((int)pointsize % 2) ? (-1) : 0));
                cpack(0xFF);
        
-               bglBegin(GL_POINTS);
+               glBegin(GL_POINTS);
                BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
                        if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
                                continue;
@@ -924,16 +924,16 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                                luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
                                if (luv->flag & MLOOPUV_PINNED)
-                                       bglVertex2fv(luv->uv);
+                                       glVertex2fv(luv->uv);
                        }
                }
-               bglEnd();
+               glEnd();
        
                /* selected uvs */
                UI_ThemeColor(TH_VERTEX_SELECT);
                glPointSize(pointsize);
        
-               bglBegin(GL_POINTS);
+               glBegin(GL_POINTS);
                BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
                        if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
                                continue;
@@ -942,10 +942,10 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                                luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
                                if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset))
-                                       bglVertex2fv(luv->uv);
+                                       glVertex2fv(luv->uv);
                        }
                }
-               bglEnd();
+               glEnd();
        }
 
        glPointSize(1.0);