Renamed "fake" OpenGL identifiers.
authorJason Wilkins <Jason.A.Wilkins@gmail.com>
Fri, 4 May 2012 11:50:11 +0000 (11:50 +0000)
committerJason Wilkins <Jason.A.Wilkins@gmail.com>
Fri, 4 May 2012 11:50:11 +0000 (11:50 +0000)
Any identifier that looks like an OpenGL identifier, but isn't, causes a false alarm by the glreport.py tool.  Most of these were in comments so I just rephrased the comments.  There were a couple of static functions/macros that were easy enough to rename.  Only the glTexco and glIndex fields of the DMVertexAttribs struct was public and had non-local uses.

15 files changed:
intern/ghost/intern/GHOST_WindowWin32.cpp
source/blender/blenfont/intern/blf_internal_types.h
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/editors/include/BIF_glutil.h
source/blender/editors/interface/interface_draw.c
source/blender/editors/screen/glutil.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/gpu/intern/gpu_draw.c
source/blender/windowmanager/intern/wm_draw.c
source/blender/windowmanager/intern/wm_subwindow.c

index 9d105748095bf8427affcd5f62e172e12493add4..3715da12cd6d675a6aff51e2c1524d9848321f7f 100644 (file)
@@ -55,7 +55,7 @@
 #endif
 
 // Some more multisample defines
-#define WGL_SAMPLE_BUFERS_ARB  0x2041
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
 #define        WGL_SAMPLES_ARB                 0x2042
 
 // win64 doesn't define GWL_USERDATA
index cbe7975fdd6897a20d3be566d1fef0afc84c8967..bf9b98583481e08f68cddcdcc268128e4d3c8661 100644 (file)
@@ -180,7 +180,7 @@ typedef struct FontBLF {
        /* max texture size. */
        int max_tex_size;
 
-       /* current opengl texture  bind, avoids calling glGet */
+       /* cache current OpenGL texture to save calls into the API */
        int tex_bind_state;
 
        /* font options. */
index 3a28af97166234cc517c46ef526ac343ed21c93c..a15192f156a904cbcdf9f6abd93e3a233f470e1d 100644 (file)
@@ -664,22 +664,22 @@ void DM_update_weight_mcol(struct Object *ob, struct DerivedMesh *dm, int const
 typedef struct DMVertexAttribs {
        struct {
                struct MTFace *array;
-               int emOffset, glIndex, glTexco;
+               int em_offset, gl_index, gl_texco;
        } tface[MAX_MTFACE];
 
        struct {
                struct MCol *array;
-               int emOffset, glIndex;
+               int em_offset, gl_index;
        } mcol[MAX_MCOL];
 
        struct {
                float (*array)[4];
-               int emOffset, glIndex;
+               int em_offset, gl_index;
        } tang;
 
        struct {
                float (*array)[3];
-               int emOffset, glIndex, glTexco;
+               int em_offset, gl_index, gl_texco;
        } orco;
 
        int tottface, totmcol, tottang, totorco;
index 74373d28c1443e002065d1606d14ff08a891ca28..f648a9e297c3c281be50316ab4e8db453d6bba67 100644 (file)
@@ -2786,9 +2786,9 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
                                        a = attribs->tottface++;
 
                                        attribs->tface[a].array = tfdata->layers[layer].data;
-                                       attribs->tface[a].emOffset = tfdata->layers[layer].offset;
-                                       attribs->tface[a].glIndex = gattribs->layer[b].glindex;
-                                       attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
+                                       attribs->tface[a].em_offset = tfdata->layers[layer].offset;
+                                       attribs->tface[a].gl_index = gattribs->layer[b].glindex;
+                                       attribs->tface[a].gl_texco = gattribs->layer[b].gltexco;
                                }
                        }
                        else {
@@ -2802,9 +2802,9 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
                                        a = attribs->tottface++;
 
                                        attribs->tface[a].array = tfdata->layers[layer].data;
-                                       attribs->tface[a].emOffset = tfdata->layers[layer].offset;
-                                       attribs->tface[a].glIndex = gattribs->layer[b].glindex;
-                                       attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
+                                       attribs->tface[a].em_offset = tfdata->layers[layer].offset;
+                                       attribs->tface[a].gl_index = gattribs->layer[b].glindex;
+                                       attribs->tface[a].gl_texco = gattribs->layer[b].gltexco;
                                }
                        }
                }
@@ -2823,8 +2823,8 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
                                        a = attribs->totmcol++;
 
                                        attribs->mcol[a].array = tfdata->layers[layer].data;
-                                       attribs->mcol[a].emOffset = tfdata->layers[layer].offset;
-                                       attribs->mcol[a].glIndex = gattribs->layer[b].glindex;
+                                       attribs->mcol[a].em_offset = tfdata->layers[layer].offset;
+                                       attribs->mcol[a].gl_index = gattribs->layer[b].glindex;
                                }
                        }
                        else {
@@ -2839,8 +2839,8 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
                                        a = attribs->totmcol++;
 
                                        attribs->mcol[a].array = tfdata->layers[layer].data;
-                                       attribs->mcol[a].emOffset = tfdata->layers[layer].offset;
-                                       attribs->mcol[a].glIndex = gattribs->layer[b].glindex;
+                                       attribs->mcol[a].em_offset = tfdata->layers[layer].offset;
+                                       attribs->mcol[a].gl_index = gattribs->layer[b].glindex;
                                }
                        }
                }
@@ -2852,8 +2852,8 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
                                attribs->tottang = 1;
 
                                attribs->tang.array = fdata->layers[layer].data;
-                               attribs->tang.emOffset = fdata->layers[layer].offset;
-                               attribs->tang.glIndex = gattribs->layer[b].glindex;
+                               attribs->tang.em_offset = fdata->layers[layer].offset;
+                               attribs->tang.gl_index = gattribs->layer[b].glindex;
                        }
                }
                else if (gattribs->layer[b].type == CD_ORCO) {
@@ -2864,9 +2864,9 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
                                attribs->totorco = 1;
 
                                attribs->orco.array = vdata->layers[layer].data;
-                               attribs->orco.emOffset = vdata->layers[layer].offset;
-                               attribs->orco.glIndex = gattribs->layer[b].glindex;
-                               attribs->orco.glTexco = gattribs->layer[b].gltexco;
+                               attribs->orco.em_offset = vdata->layers[layer].offset;
+                               attribs->orco.gl_index = gattribs->layer[b].glindex;
+                               attribs->orco.gl_texco = gattribs->layer[b].gltexco;
                        }
                }
        }
index 19e66b957ebed6ca2fd27ee909d92bfc7c3834b7..78a8b975b854ed0388a02baae632bbc3887a0703 100644 (file)
@@ -989,20 +989,20 @@ static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int
 
        /* orco texture coordinates */
        if (attribs->totorco) {
-               if (attribs->orco.glTexco)
+               if (attribs->orco.gl_texco)
                        glTexCoord3fv(attribs->orco.array[index]);
                else
-                       glVertexAttrib3fvARB(attribs->orco.glIndex, attribs->orco.array[index]);
+                       glVertexAttrib3fvARB(attribs->orco.gl_index, attribs->orco.array[index]);
        }
 
        /* uv texture coordinates */
        for (b = 0; b < attribs->tottface; b++) {
                MTFace *tf = &attribs->tface[b].array[a];
 
-               if (attribs->tface[b].glTexco)
+               if (attribs->tface[b].gl_texco)
                        glTexCoord2fv(tf->uv[vert]);
                else
-                       glVertexAttrib2fvARB(attribs->tface[b].glIndex, tf->uv[vert]);
+                       glVertexAttrib2fvARB(attribs->tface[b].gl_index, tf->uv[vert]);
        }
 
        /* vertex colors */
@@ -1010,13 +1010,13 @@ static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int
                MCol *cp = &attribs->mcol[b].array[a*4 + vert];
                GLubyte col[4];
                col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
-               glVertexAttrib4ubvARB(attribs->mcol[b].glIndex, col);
+               glVertexAttrib4ubvARB(attribs->mcol[b].gl_index, col);
        }
 
        /* tangent for normal mapping */
        if (attribs->tottang) {
                float *tang = attribs->tang.array[a*4 + vert];
-               glVertexAttrib4fvARB(attribs->tang.glIndex, tang);
+               glVertexAttrib4fvARB(attribs->tang.gl_index, tang);
        }
 
        /* vertex normal */
@@ -1167,25 +1167,25 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
                                                DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
 
                                                if (attribs.totorco) {
-                                                       datatypes[numdata].index = attribs.orco.glIndex;
+                                                       datatypes[numdata].index = attribs.orco.gl_index;
                                                        datatypes[numdata].size = 3;
                                                        datatypes[numdata].type = GL_FLOAT;
                                                        numdata++;
                                                }
                                                for (b = 0; b < attribs.tottface; b++) {
-                                                       datatypes[numdata].index = attribs.tface[b].glIndex;
+                                                       datatypes[numdata].index = attribs.tface[b].gl_index;
                                                        datatypes[numdata].size = 2;
                                                        datatypes[numdata].type = GL_FLOAT;
                                                        numdata++;
                                                }       
                                                for (b = 0; b < attribs.totmcol; b++) {
-                                                       datatypes[numdata].index = attribs.mcol[b].glIndex;
+                                                       datatypes[numdata].index = attribs.mcol[b].gl_index;
                                                        datatypes[numdata].size = 4;
                                                        datatypes[numdata].type = GL_UNSIGNED_BYTE;
                                                        numdata++;
                                                }       
                                                if (attribs.tottang) {
-                                                       datatypes[numdata].index = attribs.tang.glIndex;
+                                                       datatypes[numdata].index = attribs.tang.gl_index;
                                                        datatypes[numdata].size = 4;
                                                        datatypes[numdata].type = GL_FLOAT;
                                                        numdata++;
index 9fd6a4e9ba4cae2d39759da2ad3d3af53b50486f..8d7ac99e2a39b53fe2eed7ee93443be2a5f797b4 100644 (file)
@@ -1013,21 +1013,21 @@ static void emDM_drawMappedFacesGLSL(
 #define PASSATTRIB(loop, eve, vert) {                                                                                  \
        if (attribs.totorco) {                                                                                                          \
                float *orco = attribs.orco.array[BM_elem_index_get(eve)];                                               \
-               glVertexAttrib3fvARB(attribs.orco.glIndex, orco);                                               \
+               glVertexAttrib3fvARB(attribs.orco.gl_index, orco);                                              \
        }                                                                                                                                                       \
        for (b = 0; b < attribs.tottface; b++) {                                                                        \
                MLoopUV *_luv = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, CD_MLOOPUV, b);\
-               glVertexAttrib2fvARB(attribs.tface[b].glIndex, _luv->uv);                               \
+               glVertexAttrib2fvARB(attribs.tface[b].gl_index, _luv->uv);                              \
        }                                                                                                                                                       \
        for (b = 0; b < attribs.totmcol; b++) {                                                                         \
                MLoopCol *_cp = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, CD_MLOOPCOL, b);\
                GLubyte _col[4];                                                                                                                \
                _col[0]= _cp->b; _col[1]= _cp->g; _col[2]= _cp->r; _col[3]= _cp->a;             \
-               glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, _col);                                   \
+               glVertexAttrib4ubvARB(attribs.mcol[b].gl_index, _col);                                  \
        }                                                                                                                                                       \
        if (attribs.tottang) {                                                                                                          \
                float *tang = attribs.tang.array[i*4 + vert];                                                   \
-               glVertexAttrib3fvARB(attribs.tang.glIndex, tang);                                               \
+               glVertexAttrib3fvARB(attribs.tang.gl_index, tang);                                              \
        }                                                                                                                                                       \
        }
 
@@ -1136,27 +1136,27 @@ static void emDM_drawMappedFacesMat(
 #define PASSATTRIB(loop, eve, vert) {                                                                                  \
        if (attribs.totorco) {                                                                                                          \
                float *orco = attribs.orco.array[BM_elem_index_get(eve)];                               \
-               if (attribs.orco.glTexco)                                                                                               \
+               if (attribs.orco.gl_texco)                                                                                              \
                        glTexCoord3fv(orco);                                                                                            \
                else                                                                                                                                    \
-                       glVertexAttrib3fvARB(attribs.orco.glIndex, orco);                                       \
+                       glVertexAttrib3fvARB(attribs.orco.gl_index, orco);                                      \
        }                                                                                                                                                       \
        for (b = 0; b < attribs.tottface; b++) {                                                                        \
                MLoopUV *_luv = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, CD_MLOOPUV, b);\
-               if (attribs.tface[b].glTexco)                                                                                   \
+               if (attribs.tface[b].gl_texco)                                                                                  \
                        glTexCoord2fv(_luv->uv);                                                                                        \
                else                                                                                                                                    \
-                       glVertexAttrib2fvARB(attribs.tface[b].glIndex, _luv->uv);                       \
+                       glVertexAttrib2fvARB(attribs.tface[b].gl_index, _luv->uv);                      \
        }                                                                                                                                                       \
        for (b = 0; b < attribs.totmcol; b++) {                                                                         \
                MLoopCol *_cp = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, CD_MLOOPCOL, b);\
                GLubyte _col[4];                                                                                                                \
                _col[0]= _cp->b; _col[1]= _cp->g; _col[2]= _cp->r; _col[3]= _cp->a;             \
-               glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, _col);                                   \
+               glVertexAttrib4ubvARB(attribs.mcol[b].gl_index, _col);                                  \
        }                                                                                                                                                       \
        if (attribs.tottang) {                                                                                                          \
                float *tang = attribs.tang.array[i*4 + vert];                                                   \
-               glVertexAttrib4fvARB(attribs.tang.glIndex, tang);                                               \
+               glVertexAttrib4fvARB(attribs.tang.gl_index, tang);                                              \
        }                                                                                                                                                       \
 }
 
index ddc605eb3e08ab81c3ff67f04683bef179dd1cdc..b3b704bf2a210ae93b2eb62aadd4c29fd831d87a 100644 (file)
@@ -1718,21 +1718,21 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
 #define PASSATTRIB(dx, dy, vert) {                                              \
        if (attribs.totorco) {                                                      \
                index = getFaceIndex(ss, f, S, x + dx, y + dy, edgeSize, gridSize);     \
-               glVertexAttrib3fvARB(attribs.orco.glIndex, attribs.orco.array[index]);  \
+               glVertexAttrib3fvARB(attribs.orco.gl_index, attribs.orco.array[index]);  \
        }                                                                           \
        for (b = 0; b < attribs.tottface; b++) {                                    \
                MTFace *tf = &attribs.tface[b].array[a];                                \
-               glVertexAttrib2fvARB(attribs.tface[b].glIndex, tf->uv[vert]);           \
+               glVertexAttrib2fvARB(attribs.tface[b].gl_index, tf->uv[vert]);           \
        }                                                                           \
        for (b = 0; b < attribs.totmcol; b++) {                                     \
                MCol *cp = &attribs.mcol[b].array[a * 4 + vert];                        \
                GLubyte col[4];                                                         \
                col[0] = cp->b; col[1] = cp->g; col[2] = cp->r; col[3] = cp->a;         \
-               glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col);                    \
+               glVertexAttrib4ubvARB(attribs.mcol[b].gl_index, col);                    \
        }                                                                           \
        if (attribs.tottang) {                                                      \
                float *tang = attribs.tang.array[a * 4 + vert];                         \
-               glVertexAttrib4fvARB(attribs.tang.glIndex, tang);                       \
+               glVertexAttrib4fvARB(attribs.tang.gl_index, tang);                       \
        }                                                                           \
 }
 
@@ -1863,27 +1863,27 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *
 #define PASSATTRIB(dx, dy, vert) {                                              \
        if (attribs.totorco) {                                                      \
                index = getFaceIndex(ss, f, S, x + dx, y + dy, edgeSize, gridSize);     \
-               if (attribs.orco.glTexco)                                               \
+               if (attribs.orco.gl_texco)                                               \
                        glTexCoord3fv(attribs.orco.array[index]);                           \
                else                                                                    \
-                       glVertexAttrib3fvARB(attribs.orco.glIndex, attribs.orco.array[index]);  \
+                       glVertexAttrib3fvARB(attribs.orco.gl_index, attribs.orco.array[index]);  \
        }                                                                           \
        for (b = 0; b < attribs.tottface; b++) {                                    \
                MTFace *tf = &attribs.tface[b].array[a];                                \
-               if (attribs.tface[b].glTexco)                                           \
+               if (attribs.tface[b].gl_texco)                                           \
                        glTexCoord2fv(tf->uv[vert]);                                        \
                else                                                                    \
-                       glVertexAttrib2fvARB(attribs.tface[b].glIndex, tf->uv[vert]);       \
+                       glVertexAttrib2fvARB(attribs.tface[b].gl_index, tf->uv[vert]);       \
        }                                                                           \
        for (b = 0; b < attribs.totmcol; b++) {                                     \
                MCol *cp = &attribs.mcol[b].array[a * 4 + vert];                        \
                GLubyte col[4];                                                         \
                col[0] = cp->b; col[1] = cp->g; col[2] = cp->r; col[3] = cp->a;         \
-               glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col);                    \
+               glVertexAttrib4ubvARB(attribs.mcol[b].gl_index, col);                    \
        }                                                                           \
        if (attribs.tottang) {                                                      \
                float *tang = attribs.tang.array[a * 4 + vert];                         \
-               glVertexAttrib4fvARB(attribs.tang.glIndex, tang);                       \
+               glVertexAttrib4fvARB(attribs.tang.gl_index, tang);                       \
        }                                                                           \
 }
 
index 44195988c40f7f7a45770bb4ca60020679409d10..2172aa82acf576d360500b85397a8fe9898d0b60 100644 (file)
@@ -49,7 +49,8 @@ void fdrawXORcirc(float xofs, float yofs, float rad);
 
 void fdrawcheckerboard(float x1, float y1, float x2, float y2);
 
-/* glStipple defines */
+/* OpenGL stipple defines */
+/* OpenGL stipple defines */
 extern unsigned char stipple_halftone[128];
 extern unsigned char stipple_quarttone[128];
 extern unsigned char stipple_diag_stripes_pos[128];
@@ -147,13 +148,14 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
        /* 2D Drawing Assistance */
 
        /** Define a 2D area (viewport, scissor, matrices) for OpenGL rendering.
-        * This routine sets up an OpenGL state appropriate for drawing using
-        * both vertice (glVertex, etc) and raster (glRasterPos, glRect) commands.
-        * All coordinates should be at integer positions. There is little to
-        * no reason to use glVertex2f etc. functions during 2D rendering, and
+     *
+     * glwDefine2DArea and glaBegin2DDraw set up an OpenGL state appropriate
+     * for drawing using both vertice (Vertex, etc) and raster (RasterPos, Rect)
+     * commands. All coordinates should be at integer positions. There is little
+     * to no reason to use glVertex2f etc. functions during 2D rendering, and
         * thus no reason to +-0.5 the coordinates or perform other silly
         * tricks.
-        *
+     *
         * \param screen_rect The screen rectangle to be defined for 2D drawing.
         */
 void glaDefine2DArea           (struct rcti *screen_rect);
@@ -165,13 +167,8 @@ typedef struct gla2DDrawInfo gla2DDrawInfo;
         * to free it and to return OpenGL to its previous state. The
         * scissor rectangle is set to match the viewport.
         *
-        * This routine sets up an OpenGL state appropriate for drawing using
-        * both vertice (glVertex, etc) and raster (glRasterPos, glRect) commands.
-        * All coordinates should be at integer positions. There is little to
-        * no reason to use glVertex2f etc. functions during 2D rendering, and
-        * thus no reason to +-0.5 the coordinates or perform other silly
-        * tricks.
-        *
+     * See glaDefine2DArea for an explanation of why this function uses integers.
+     *
         * \param screen_rect The screen rectangle to be used for 2D drawing.
         * \param world_rect The world rectangle that the 2D area represented
         * by \a screen_rect is supposed to represent. If NULL it is assumed the
index d90d8286db9a8afa796cf67c3d1ab86ec39c4945..8c5913e23fb8cdf9f59a4331281153d3e3b76066 100644 (file)
@@ -1196,7 +1196,7 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
        
        ui_get_but_vectorf(but, dir);
 
-       dir[3] = 0.0f;   /* glLight needs 4 args, 0.0 is sun */
+       dir[3] = 0.0f;   /* glLightfv needs 4 args, 0.0 is sun */
        glLightfv(GL_LIGHT7, GL_POSITION, dir); 
        glLightfv(GL_LIGHT7, GL_DIFFUSE, diffn); 
        glLightfv(GL_LIGHT7, GL_SPECULAR, vec0); 
@@ -1281,7 +1281,7 @@ static void ui_draw_but_curve_grid(rcti *rect, float zoomx, float zoomy, float o
        
 }
 
-static void glColor3ubvShade(unsigned char *col, int shade)
+static void gl_shaded_color(unsigned char *col, int shade)
 {
        glColor3ub(col[0] - shade > 0 ? col[0] - shade : 0,
                   col[1] - shade > 0 ? col[1] - shade : 0,
@@ -1318,7 +1318,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
        
        /* backdrop */
        if (cumap->flag & CUMA_DO_CLIP) {
-               glColor3ubvShade((unsigned char *)wcol->inner, -20);
+               gl_shaded_color((unsigned char *)wcol->inner, -20);
                glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
                glColor3ubv((unsigned char *)wcol->inner);
                glRectf(rect->xmin + zoomx * (cumap->clipr.xmin - offsx),
@@ -1332,13 +1332,13 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
        }
                
        /* grid, every .25 step */
-       glColor3ubvShade((unsigned char *)wcol->inner, -16);
+       gl_shaded_color((unsigned char *)wcol->inner, -16);
        ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 0.25f);
        /* grid, every 1.0 step */
-       glColor3ubvShade((unsigned char *)wcol->inner, -24);
+       gl_shaded_color((unsigned char *)wcol->inner, -24);
        ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 1.0f);
        /* axes */
-       glColor3ubvShade((unsigned char *)wcol->inner, -50);
+       gl_shaded_color((unsigned char *)wcol->inner, -50);
        glBegin(GL_LINES);
        glVertex2f(rect->xmin, rect->ymin + zoomy * (-offsy));
        glVertex2f(rect->xmax, rect->ymin + zoomy * (-offsy));
index 50430399f095076df102f10f3de276cc63b58789..69db65fda1c3433b8c4f219589a145b6f82b4bcf 100644 (file)
@@ -297,13 +297,13 @@ void setlinestyle(int nr)
 
        /* Invert line handling */
        
-#define glToggle(mode, onoff)  (((onoff)?glEnable:glDisable)(mode))
+#define gl_toggle(mode, onoff) (((onoff)?glEnable:glDisable)(mode))
 
 void set_inverted_drawing(int enable) 
 {
        glLogicOp(enable?GL_INVERT:GL_COPY);
-       glToggle(GL_COLOR_LOGIC_OP, enable);
-       glToggle(GL_DITHER, !enable);
+       gl_toggle(GL_COLOR_LOGIC_OP, enable);
+       gl_toggle(GL_DITHER, !enable);
 }
 
 void sdrawXORline(int x0, int y0, int x1, int y1)
@@ -781,7 +781,7 @@ void glaEnd2DDraw(gla2DDrawInfo *di)
 }
 #endif
 
-/* **************** glPoint hack ************************ */
+/* **************** GL_POINT hack ************************ */
 
 static int curmode=0;
 static int pointhack=0;
index fec93b3b9aa87d65f095e1e766cb90cff8ee1c66..15e6994dfe4b337059c6b0ca5ce50b8a545b402f 100644 (file)
@@ -1297,7 +1297,7 @@ static void draw_bone(int dt, int armflag, int boneflag, short constflag, unsign
 {
        
        /* Draw a 3d octahedral bone, we use normalized space based on length,
-        * for glDisplayLists */
+        * for display-lists */
        
        glScalef(length, length, length);
 
@@ -1996,7 +1996,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
 
        /* finally names and axes */
        if ((arm->flag & (ARM_DRAWNAMES | ARM_DRAWAXES)) && (is_outline == 0)) {
-               /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
+               /* patch for several 3d cards (IBM mostly) that crash on GL_SELECT with text drawing */
                if ((G.f & G_PICKSEL) == 0) {
                        float vec[3];
                        
@@ -2208,7 +2208,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
        
        /* finally names and axes */
        if (arm->flag & (ARM_DRAWNAMES | ARM_DRAWAXES)) {
-               // patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing
+               // patch for several 3d cards (IBM mostly) that crash on GL_SELECT with text drawing
                if ((G.f & G_PICKSEL) == 0) {
                        float vec[3];
                        unsigned char col[4];
index 585fc43e5c23b6547cbba990dff766040f1aa3cd..36b11b2c28bb253db631264dd118f90888cdebc6 100644 (file)
@@ -6990,7 +6990,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                                drawtexspace(ob);
                        }
                        if (dtx & OB_DRAWNAME) {
-                               /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
+                               /* patch for several 3d cards (IBM mostly) that crash on GL_SELECT with text drawing */
                                /* but, we also don't draw names for sets or duplicators */
                                if (flag == 0) {
                                        float zero[3] = {0, 0, 0};
index 1c1cf8017f653eab9e02389de6339569f1e56add..b2c2bc092b2ca0ed17a7892ffbb8456236454b07 100644 (file)
@@ -1304,7 +1304,7 @@ void GPU_end_object_materials(void)
        GMS.gmatbuf= NULL;
        GMS.alphablend= NULL;
 
-       /* resetting the texture matrix after the glScale needed for tiled textures */
+       /* resetting the texture matrix after the scaling needed for tiled textures */
        if (GTS.tilemode) {
                glMatrixMode(GL_TEXTURE);
                glLoadIdentity();
index 66cadf1e76a937260b7860cc159d465e0560deb6..2b83a55d7bb1b43dd252067eada6cb18e67a0b5c 100644 (file)
@@ -475,7 +475,7 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
                        glTexImage2D(triple->target, 0, GL_RGB8, triple->x[x], triple->y[y], 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
                        glTexParameteri(triple->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
                        glTexParameteri(triple->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-                       // glColor still used with this enabled?
+                       // The current color is ignored if the GL_REPLACE texture environment is used.
                        // glTexEnvi(triple->target, GL_TEXTURE_ENV_MODE, GL_REPLACE);
                        glBindTexture(triple->target, 0);
 
index 6ffb28ba0130ddf063d4590e47c786e9c211638c..563eef8304c624f4b66b54f1cb1697762f6ce087 100644 (file)
@@ -237,7 +237,7 @@ void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct)
        }
 }
 
-/* ---------------- WM versions of OpenGL calls, using glBlah() syntax ------------------------ */
+/* ---------------- WM versions of OpenGL style API calls ------------------------ */
 /* ----------------- exported in WM_api.h ------------------------------------------------------ */
 
 /* internal state, no threaded opengl! XXX */