diff mbox

[Branch,~afrantzis/glmark2/trunk] Rev 85: Ensure all Mesh instance variables are properly initialized and reset.

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

Commit Message

alexandros.frantzis@linaro.org June 21, 2011, 12:49 p.m. UTC
------------------------------------------------------------
revno: 85
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Tue 2011-06-21 15:24:15 +0300
message:
  Ensure all Mesh instance variables are properly initialized and reset.
modified:
  src/mesh.cpp


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

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

Patch

=== modified file 'src/mesh.cpp'
--- src/mesh.cpp	2011-06-17 13:16:16 +0000
+++ src/mesh.cpp	2011-06-21 12:24:15 +0000
@@ -24,12 +24,11 @@ 
 #include "mesh.h"
 
 
-Mesh::Mesh()
+Mesh::Mesh() :
+    mVertexQty(0), mPolygonQty(0),
+    mMode(GL_TRIANGLES), mVertex(0),
+    mVBOVertices(0), mVBONormals(0), mVBOTexCoords(0)
 {
-    mPolygonQty = 0;
-    mVertexQty = 0;
-    mMode = GL_TRIANGLES;
-    mVertex = 0;
 }
 
 Mesh::~Mesh()
@@ -199,6 +198,10 @@ 
     glDeleteBuffers(1, &mVBOVertices);
     glDeleteBuffers(1, &mVBONormals);
     glDeleteBuffers(1, &mVBOTexCoords);
+
+    mVBOVertices = 0;
+    mVBONormals = 0;
+    mVBOTexCoords = 0;
 }
 
 void Mesh::render_vbo(int vertex_loc, int normal_loc, int texcoord_loc)