=== modified file 'mesh.cpp'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -137,5 +137,5 @@
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, mTexture[mCurrentPart]);
- mCubeMesh.render_vbo_attrib();
+ mCubeMesh.render_vbo();
}