diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 39: Remove OpenGL 1.x compatible Mesh::render_vbo() and Mesh::render_array() methods.

Message ID 20110721123632.17019.72849.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Alexandros Frantzis July 21, 2011, 12:36 p.m. UTC
------------------------------------------------------------
revno: 39
committer: Alexandros Frantzis <alf82@freemail.gr>
timestamp: Mon 2010-07-12 11:28:14 +0300
message:
  Remove OpenGL 1.x compatible Mesh::render_vbo() and Mesh::render_array() methods.
  Rename Mesh::render_vbo_attrib() and Mesh::render_array_attrib() to Mesh::render_vbo() and Mesh::render_array().
modified:
  mesh.cpp
  mesh.h
  scenebuild.cpp
  sceneshading.cpp
  scenetexture.cpp


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'mesh.cpp'
--- mesh.cpp	2010-07-12 08:05:45 +0000
+++ mesh.cpp	2010-07-12 08:28:14 +0000
@@ -87,22 +87,6 @@ 
 
 void Mesh::render_array()
 {
-    glEnableClientState(GL_VERTEX_ARRAY);
-    glEnableClientState(GL_NORMAL_ARRAY);
-    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
-    glVertexPointer(3, GL_FLOAT, sizeof(Vertex), &mVertex[0].v.x);
-    glNormalPointer(GL_FLOAT, sizeof(Vertex), &mVertex[0].n.x);
-    glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), &mVertex[0].t.u);
-    glDrawArrays(mMode, 0, mVertexQty);
-
-    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-    glDisableClientState(GL_VERTEX_ARRAY);
-    glDisableClientState(GL_NORMAL_ARRAY);
-}
-
-void Mesh::render_array_attrib()
-{
     // Enable the attributes
     glEnableVertexAttribArray(Shader::VertexAttribLocation);
     glEnableVertexAttribArray(Shader::NormalAttribLocation);
@@ -175,28 +159,6 @@ 
 
 void Mesh::render_vbo()
 {
-    glEnableClientState(GL_VERTEX_ARRAY);
-    glEnableClientState(GL_NORMAL_ARRAY);
-    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
-    glBindBuffer(GL_ARRAY_BUFFER, mVBOVertices);
-    glVertexPointer(3, GL_FLOAT, 0, 0);
-    glBindBuffer(GL_ARRAY_BUFFER, mVBONormals);
-    glNormalPointer(GL_FLOAT, 0, 0);
-    glBindBuffer(GL_ARRAY_BUFFER, mVBOTexCoords);
-    glTexCoordPointer(2, GL_FLOAT, 0, 0);
-
-    glDrawArrays(GL_TRIANGLES, 0, mVertexQty);
-
-    glBindBuffer(GL_ARRAY_BUFFER, 0);
-
-    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-    glDisableClientState(GL_NORMAL_ARRAY);
-    glDisableClientState(GL_VERTEX_ARRAY);
-}
-
-void Mesh::render_vbo_attrib()
-{
     // Enable the attributes
     glEnableVertexAttribArray(Shader::VertexAttribLocation);
     glEnableVertexAttribArray(Shader::NormalAttribLocation);

=== modified file 'mesh.h'
--- mesh.h	2010-07-09 10:13:39 +0000
+++ mesh.h	2010-07-12 08:28:14 +0000
@@ -44,10 +44,8 @@ 
     void make_cube();
     void make_torus();
     void render_array();
-    void render_array_attrib();
     void build_vbo();
     void render_vbo();
-    void render_vbo_attrib();
 };
 
 #endif

=== modified file 'scenebuild.cpp'
--- scenebuild.cpp	2010-07-09 12:16:42 +0000
+++ scenebuild.cpp	2010-07-12 08:28:14 +0000
@@ -127,10 +127,10 @@ 
     switch(mCurrentPart)
     {
     case 0:
-        mMesh.render_array_attrib();
+        mMesh.render_array();
         break;
     case 1:
-        mMesh.render_vbo_attrib();
+        mMesh.render_vbo();
         break;
     }    
 }

=== modified file 'sceneshading.cpp'
--- sceneshading.cpp	2010-07-09 12:16:42 +0000
+++ sceneshading.cpp	2010-07-12 08:28:14 +0000
@@ -156,5 +156,5 @@ 
     glUniformMatrix4fv(mShader[mCurrentPart].mLocations.NormalMatrix, 1,
                        GL_FALSE, model_view.m);
 
-    mMesh.render_vbo_attrib();
+    mMesh.render_vbo();
 }

=== modified file 'scenetexture.cpp'
--- scenetexture.cpp	2010-07-09 14:21:56 +0000
+++ scenetexture.cpp	2010-07-12 08:28:14 +0000
@@ -137,5 +137,5 @@ 
     glActiveTexture(GL_TEXTURE0);
     glBindTexture(GL_TEXTURE_2D, mTexture[mCurrentPart]);
 
-    mCubeMesh.render_vbo_attrib();
+    mCubeMesh.render_vbo();
 }