Revision: 48280
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48280
Author:   jwilkins
Date:     2012-06-25 17:26:32 +0000 (Mon, 25 Jun 2012)
Log Message:
-----------
Big Commit - Ported Blender/BGE to use GPU_compatibility for most drawing.

Replaces glBegin/glEnd with gpuBegin/gpuEnd
Replaces client side arrays with gpuDrawArrays/gpuDrawElements/gpuDrawElements
Replaces GLUquadric and other simple geometric primitives with a new primitive 
library
Replaces display lists with the ability to save geometry buffers and invoke 
them with glDraw/glRepeat

Not complete, there are still some places where old functions remain.  
Especially in test programs and external libraries.
Not tested thoroughly yet!  I've tested a lot, but there are still lots of 
regressions.

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/blenfont/intern/blf.c
    
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/DerivedMesh.c
    
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/cdderivedmesh.c
    
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/editderivedmesh.c
    
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/subsurf_ccg.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/animation/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/animation/anim_channels_defines.c
    branches/soc-2012-swiss_cheese/source/blender/editors/animation/anim_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/animation/anim_markers.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/animation/keyframes_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/armature/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/armature/editarmature_sketch.c
    branches/soc-2012-swiss_cheese/source/blender/editors/armature/reeb.c
    branches/soc-2012-swiss_cheese/source/blender/editors/gpencil/CMakeLists.txt
    branches/soc-2012-swiss_cheese/source/blender/editors/gpencil/drawgpencil.c
    branches/soc-2012-swiss_cheese/source/blender/editors/include/BIF_gl.h
    branches/soc-2012-swiss_cheese/source/blender/editors/include/BIF_glutil.h
    branches/soc-2012-swiss_cheese/source/blender/editors/include/ED_view3d.h
    branches/soc-2012-swiss_cheese/source/blender/editors/include/UI_resources.h
    branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_icons.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_panel.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_regions.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_widgets.c
    branches/soc-2012-swiss_cheese/source/blender/editors/interface/resources.c
    branches/soc-2012-swiss_cheese/source/blender/editors/interface/view2d.c
    branches/soc-2012-swiss_cheese/source/blender/editors/mesh/CMakeLists.txt
    branches/soc-2012-swiss_cheese/source/blender/editors/mesh/editmesh_knife.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/mesh/editmesh_loopcut.c
    branches/soc-2012-swiss_cheese/source/blender/editors/mesh/editmesh_select.c
    branches/soc-2012-swiss_cheese/source/blender/editors/mesh/editmesh_slide.c
    branches/soc-2012-swiss_cheese/source/blender/editors/physics/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/physics/particle_edit.c
    branches/soc-2012-swiss_cheese/source/blender/editors/screen/CMakeLists.txt
    branches/soc-2012-swiss_cheese/source/blender/editors/screen/area.c
    branches/soc-2012-swiss_cheese/source/blender/editors/screen/glutil.c
    branches/soc-2012-swiss_cheese/source/blender/editors/screen/screen_edit.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_cursor.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_image.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_stroke.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_action/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_action/action_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_clip/clip_dopesheet_draw.c
    branches/soc-2012-swiss_cheese/source/blender/editors/space_clip/clip_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_clip/clip_graph_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_clip/clip_utils.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_console/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_console/console_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_file/CMakeLists.txt
    branches/soc-2012-swiss_cheese/source/blender/editors/space_file/file_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_graph/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_graph/graph_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_graph/space_graph.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_image/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_image/image_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_info/CMakeLists.txt
    branches/soc-2012-swiss_cheese/source/blender/editors/space_info/textview.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_logic/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_logic/logic_window.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_nla/CMakeLists.txt
    branches/soc-2012-swiss_cheese/source/blender/editors/space_nla/nla_draw.c
    branches/soc-2012-swiss_cheese/source/blender/editors/space_node/drawnode.c
    branches/soc-2012-swiss_cheese/source/blender/editors/space_node/node_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_outliner/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_outliner/outliner_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_sequencer/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_sequencer/sequencer_draw.c
    branches/soc-2012-swiss_cheese/source/blender/editors/space_text/text_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_time/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_time/space_time.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_view3d/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_view3d/drawanimviz.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_view3d/drawarmature.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_view3d/drawmesh.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_view3d/drawobject.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_view3d/drawvolume.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_view3d/view3d_draw.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_view3d/view3d_fly.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/space_view3d/view3d_intern.h
    branches/soc-2012-swiss_cheese/source/blender/editors/transform/transform.c
    
branches/soc-2012-swiss_cheese/source/blender/editors/transform/transform_manipulator.c
    branches/soc-2012-swiss_cheese/source/blender/editors/uvedit/CMakeLists.txt
    branches/soc-2012-swiss_cheese/source/blender/editors/uvedit/uvedit_draw.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/CMakeLists.txt
    branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_primitives.h
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_buffers.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_draw.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.h
    
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_gl11.c
    
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_inline.h
    
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_internal.h
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_lighting.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_primitives.c
    
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_primitives_inline.h
    
branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_gesture.c
    
branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_init_exit.c
    
branches/soc-2012-swiss_cheese/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
    
branches/soc-2012-swiss_cheese/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
    
branches/soc-2012-swiss_cheese/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
    
branches/soc-2012-swiss_cheese/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
    branches/soc-2012-swiss_cheese/source/gameengine/Ketsji/KX_Dome.cpp
    branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/CMakeLists.txt
    
branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
    
branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
    
branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
    
branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp

Modified: branches/soc-2012-swiss_cheese/source/blender/blenfont/intern/blf.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/blenfont/intern/blf.c 
2012-06-25 17:26:18 UTC (rev 48279)
+++ branches/soc-2012-swiss_cheese/source/blender/blenfont/intern/blf.c 
2012-06-25 17:26:32 UTC (rev 48280)
@@ -507,7 +507,6 @@
                /* one-time GL setup */
                glEnable(GL_TEXTURE_2D);
                glEnable(GL_BLEND);
-               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        }
 
        font->locked++;
@@ -578,12 +577,9 @@
        if (font->flags & BLF_ROTATION)
                glRotatef(font->angle, 0.0f, 0.0f, 1.0f);
 
-       /* if (font->shadow || font->blur) 
-               gpuGetCurrentColor4fv(font->orig_col); */
+       if (font->shadow || font->blur) 
+               gpuGetCurrentColor4fv(font->orig_col);
 
-       gpuGetCurrentColor4fv(font->orig_col);  // XXX: workaround
-       gpuCurrentColor4fv(font->orig_col);
-
        /* always bind the texture for the first glyph */
        font->tex_bind_state = -1;
 
@@ -599,6 +595,11 @@
 
        glMatrixMode(GL_MODELVIEW);
        glPopMatrix();
+
+       /* XXX: current color becomes undefined due to use of vertex arrays,
+               but a lot of code relies on it remaining the same */
+       if (font->shadow || font->blur) 
+               gpuCurrentColor4fv(font->orig_col);
 }
 
 void BLF_draw(int fontid, const char *str, size_t len)

Modified: 
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- 
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/DerivedMesh.c   
    2012-06-25 17:26:18 UTC (rev 48279)
+++ 
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/DerivedMesh.c   
    2012-06-25 17:26:32 UTC (rev 48280)
@@ -82,6 +82,7 @@
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
 #include "GPU_material.h"
+#include "GPU_compatibility.h"
 
 static void add_shapekey_layers(DerivedMesh *dm, Mesh *me, Object *ob);
 static void shapekey_layers_to_keyblocks(DerivedMesh *dm, Mesh *me, int 
actshape_uid);
@@ -2947,7 +2948,7 @@
        /* if (GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high 
priority - campbell */
                DEBUG_VBO("Using legacy code. drawNavMeshColored\n");
                //glShadeModel(GL_SMOOTH);
-               glBegin(glmode = GL_QUADS);
+               gpuBegin(glmode = GL_QUADS);
                for (a = 0; a < dm->numTessFaceData; a++, mface++) {
                        int new_glmode = mface->v4 ? GL_QUADS : GL_TRIANGLES;
                        int pi = polygonIdx[a];
@@ -2959,18 +2960,18 @@
                        }
 
                        if (new_glmode != glmode) {
-                               glEnd();
-                               glBegin(glmode = new_glmode);
+                               gpuEnd();
+                               gpuBegin(glmode = new_glmode);
                        }
-                       glColor3fv(col);
-                       glVertex3fv(mvert[mface->v1].co);
-                       glVertex3fv(mvert[mface->v2].co);
-                       glVertex3fv(mvert[mface->v3].co);
+                       gpuColor3fv(col);
+                       gpuVertex3fv(mvert[mface->v1].co);
+                       gpuVertex3fv(mvert[mface->v2].co);
+                       gpuVertex3fv(mvert[mface->v3].co);
                        if (mface->v4) {
-                               glVertex3fv(mvert[mface->v4].co);
+                               gpuVertex3fv(mvert[mface->v4].co);
                        }
                }
-               glEnd();
+               gpuEnd();
        }
        glEnable(GL_LIGHTING);
 }

Modified: 
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- 
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/cdderivedmesh.c 
    2012-06-25 17:26:18 UTC (rev 48279)
+++ 
branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/cdderivedmesh.c 
    2012-06-25 17:26:32 UTC (rev 48280)
@@ -64,6 +64,7 @@
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
 #include "GPU_material.h"
+#include "GPU_compatibility.h"
 
 #include <string.h>
 #include <limits.h>
@@ -318,10 +319,12 @@
        int i;
 
        if (GPU_buffer_legacy(dm)) {
-               glBegin(GL_POINTS);
+               gpuImmediateFormat_V3();
+               gpuBegin(GL_POINTS);
                for (i = 0; i < dm->numVertData; i++, mv++)
-                       glVertex3fv(mv->co);
-               glEnd();
+                       gpuVertex3fv(mv->co);
+               gpuEnd();
+               gpuImmediateUnformat();
        }
        else {  /* use OpenGL VBOs or Vertex Arrays instead for better, faster 
rendering */
                GPU_vertex_setup(dm);
@@ -344,29 +347,29 @@
 
        if (mf) {
                if (GPU_buffer_legacy(dm)) {
-                       glBegin(GL_LINES);
+                       gpuBegin(GL_LINES);
                        for (i = 0; i < dm->numTessFaceData; i++, mf++, tf++) {
                                if (!(mf->flag & ME_HIDE)) {
-                                       glVertex2fv(tf->uv[0]);
-                                       glVertex2fv(tf->uv[1]);
+                                       gpuVertex2fv(tf->uv[0]);
+                                       gpuVertex2fv(tf->uv[1]);
 
-                                       glVertex2fv(tf->uv[1]);
-                                       glVertex2fv(tf->uv[2]);
+                                       gpuVertex2fv(tf->uv[1]);
+                                       gpuVertex2fv(tf->uv[2]);
 
                                        if (!mf->v4) {
-                                               glVertex2fv(tf->uv[2]);
-                                               glVertex2fv(tf->uv[0]);
+                                               gpuVertex2fv(tf->uv[2]);
+                                               gpuVertex2fv(tf->uv[0]);
                                        }
                                        else {
-                                               glVertex2fv(tf->uv[2]);
-                                               glVertex2fv(tf->uv[3]);
+                                               gpuVertex2fv(tf->uv[2]);
+                                               gpuVertex2fv(tf->uv[3]);
 
-                                               glVertex2fv(tf->uv[3]);
-                                               glVertex2fv(tf->uv[0]);
+                                               gpuVertex2fv(tf->uv[3]);
+                                               gpuVertex2fv(tf->uv[0]);
                                        }
                                }
                        }
-                       glEnd();
+                       gpuEnd();
                }
                else {
                        int prevstart = 0;
@@ -415,16 +418,24 @@
        
        if (GPU_buffer_legacy(dm)) {
                DEBUG_VBO("Using legacy code. cdDM_drawEdges\n");
-               glBegin(GL_LINES);
+               gpuImmediateFormat_V3();
+               gpuBegin(GL_LINES);
                for (i = 0; i < dm->numEdgeData; i++, medge++) {
-                       if ((drawAllEdges || (medge->flag & ME_EDGEDRAW)) &&
-                           (drawLooseEdges || !(medge->flag & ME_LOOSEEDGE)))
-                       {
-                               glVertex3fv(mvert[medge->v1].co);
-                               glVertex3fv(mvert[medge->v2].co);
+                       #define is_visible     (drawAllEdges   ||  (medge->flag 
& ME_EDGEDRAW))
+                       #define is_not_loose   (drawLooseEdges || !(medge->flag 
& ME_LOOSEEDGE))
+                       #define is_interesting (medge->flag & 
(ME_SEAM|ME_SHARP))
+
+                       if ((is_visible && is_not_loose) || is_interesting) {
+                               gpuVertex3fv(mvert[medge->v1].co);
+                               gpuVertex3fv(mvert[medge->v2].co);
                        }
+
+                       #undef is_visible
+                       #undef is_not_loose
+                       #undef is_interesting
                }
-               glEnd();
+               gpuEnd();
+               gpuImmediateUnformat();
        }
        else {  /* use OpenGL VBOs or Vertex Arrays instead for better, faster 
rendering */
                int prevstart = 0;
@@ -467,14 +478,16 @@
 
        if (GPU_buffer_legacy(dm)) {
                DEBUG_VBO("Using legacy code. cdDM_drawLooseEdges\n");
-               glBegin(GL_LINES);
+               gpuImmediateFormat_V3();
+               gpuBegin(GL_LINES);
                for (i = 0; i < dm->numEdgeData; i++, medge++) {
                        if (medge->flag & ME_LOOSEEDGE) {
-                               glVertex3fv(mvert[medge->v1].co);
-                               glVertex3fv(mvert[medge->v2].co);
+                               gpuVertex3fv(mvert[medge->v1].co);
+                               gpuVertex3fv(mvert[medge->v2].co);
                        }
                }
-               glEnd();
+               gpuEnd();
+               gpuImmediateUnformat();
        }
        else {  /* use OpenGL VBOs or Vertex Arrays instead for better, faster 
rendering */
                int prevstart = 0;
@@ -519,9 +532,9 @@
 #define PASSVERT(index) {                                              \
        if (shademodel == GL_SMOOTH) {                          \
                short *no = mvert[index].no;                    \
-               glNormal3sv(no);                                                
\
+               gpuNormal3sv(no);                                               
\
        }                                                                       
                \
-       glVertex3fv(mvert[index].co);                           \
+       gpuVertex3fv(mvert[index].co);                          \
 } (void)0
 
        if (cddm->pbvh && cddm->pbvh_draw) {
@@ -537,7 +550,8 @@
 
        if (GPU_buffer_legacy(dm)) {
                DEBUG_VBO("Using legacy code. cdDM_drawFacesSolid\n");
-               glBegin(glmode = GL_QUADS);
+               gpuImmediateFormat_N3_V3();
+               gpuBegin(glmode = GL_QUADS);
                for (a = 0; a < dm->numTessFaceData; a++, mface++) {
                        int new_glmode, new_matnr, new_shademodel;
 
@@ -546,18 +560,18 @@
                        new_shademodel = (mface->flag & ME_SMOOTH) ? GL_SMOOTH 
: GL_FLAT;
                        
                        if (new_glmode != glmode || new_matnr != matnr || 
new_shademodel != shademodel) {
-                               glEnd();
+                               gpuEnd();
 
                                drawCurrentMat = setMaterial(matnr = new_matnr, 
NULL);
 
                                glShadeModel(shademodel = new_shademodel);
-                               glBegin(glmode = new_glmode);
+                               gpuBegin(glmode = new_glmode);
                        } 
                        
                        if (drawCurrentMat) {
                                if (shademodel == GL_FLAT) {
                                        if (nors) {
-                                               glNormal3fv(nors);
+                                               gpuNormal3fv(nors);
                                        }
                                        else {
                                                /* TODO make this better (cache 
facenormals as layer?) */
@@ -568,7 +582,7 @@
                                                else {
                                                        normal_tri_v3(nor, 
mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
                                                }
-                                               glNormal3fv(nor);
+                                               gpuNormal3fv(nor);
                                        }
                                }
 
@@ -582,7 +596,8 @@
 
                        if (nors) nors += 3;
                }
-               glEnd();
+               gpuEnd();
+               gpuImmediateUnformat();
        }
        else {  /* use OpenGL VBOs or Vertex Arrays instead for better, faster 
rendering */
                GPU_vertex_setup(dm);
@@ -625,6 +640,7 @@
 
        if (GPU_buffer_legacy(dm)) {
                DEBUG_VBO("Using legacy code. cdDM_drawFacesTex_common\n");
+               gpuImmediateFormat_T2_C4_N3_V3();
                for (i = 0; i < dm->numTessFaceData; i++, mf++) {
                        MVert *mvert;
                        DMDrawOption draw_option;
@@ -650,7 +666,7 @@
 
                                if (!(mf->flag & ME_SMOOTH)) {
                                        if (nors) {
-                                               glNormal3fv(nors);
+                                               gpuCurrentNormal3fv(nors);
                                        }
                                        else {
                                                float nor[3];
@@ -660,41 +676,42 @@
                                                else {
                                                        normal_tri_v3(nor, 
mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
                                                }
-                                               glNormal3fv(nor);
+                                               gpuCurrentNormal3fv(nor);
                                        }
                                }
 
-                               glBegin(mf->v4 ? GL_QUADS : GL_TRIANGLES);
-                               if (tf) glTexCoord2fv(tf[i].uv[0]);
-                               if (cp) glColor3ub(cp[3], cp[2], cp[1]);
+                               gpuBegin(mf->v4 ? GL_QUADS : GL_TRIANGLES);
+                               if (tf) gpuTexCoord2fv(tf[i].uv[0]);
+                               if (cp) gpuColor3ub(cp[3], cp[2], cp[1]);
                                mvert = &mv[mf->v1];
-                               if (mf->flag & ME_SMOOTH) 
glNormal3sv(mvert->no);
-                               glVertex3fv(mvert->co);
+                               if (mf->flag & ME_SMOOTH) 
gpuNormal3sv(mvert->no);
+                               gpuVertex3fv(mvert->co);
                                        
-                               if (tf) glTexCoord2fv(tf[i].uv[1]);
-                               if (cp) glColor3ub(cp[7], cp[6], cp[5]);
+                               if (tf) gpuTexCoord2fv(tf[i].uv[1]);
+                               if (cp) gpuColor3ub(cp[7], cp[6], cp[5]);
                                mvert = &mv[mf->v2];
-                               if (mf->flag & ME_SMOOTH) 
glNormal3sv(mvert->no);
-                               glVertex3fv(mvert->co);
+                               if (mf->flag & ME_SMOOTH) 
gpuNormal3sv(mvert->no);
+                               gpuVertex3fv(mvert->co);
 
-                               if (tf) glTexCoord2fv(tf[i].uv[2]);
-                               if (cp) glColor3ub(cp[11], cp[10], cp[9]);
+                               if (tf) gpuTexCoord2fv(tf[i].uv[2]);
+                               if (cp) gpuColor3ub(cp[11], cp[10], cp[9]);
                                mvert = &mv[mf->v3];
-                               if (mf->flag & ME_SMOOTH) 
glNormal3sv(mvert->no);
-                               glVertex3fv(mvert->co);
+                               if (mf->flag & ME_SMOOTH) 
gpuNormal3sv(mvert->no);
+                               gpuVertex3fv(mvert->co);
 
                                if (mf->v4) {
-                                       if (tf) glTexCoord2fv(tf[i].uv[3]);
-                                       if (cp) glColor3ub(cp[15], cp[14], 
cp[13]);
+                                       if (tf) gpuTexCoord2fv(tf[i].uv[3]);
+                                       if (cp) gpuColor3ub(cp[15], cp[14], 
cp[13]);
                                        mvert = &mv[mf->v4];
-                                       if (mf->flag & ME_SMOOTH) 
glNormal3sv(mvert->no);
-                                       glVertex3fv(mvert->co);
+                                       if (mf->flag & ME_SMOOTH) 
gpuNormal3sv(mvert->no);
+                                       gpuVertex3fv(mvert->co);
                                }
-                               glEnd();

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to