Changeset 2795 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.cpp
- Timestamp:
- 06/22/08 05:24:22 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.cpp
r2786 r2795 19 19 mVboId(-1) 20 20 { 21 mHasTexture = (mTexCoords != NULL); 22 21 23 Prepare(); 22 24 23 25 if (delData) 24 26 { 25 delete [] mVertices; mVertices = NULL;26 delete [] mNormals; mNormals = NULL;27 //if (mTexCoords) delete [] mTexCoords; mTexCoords = NULL;27 DEL_ARRAY_PTR(mVertices); 28 DEL_ARRAY_PTR(mNormals); 29 DEL_ARRAY_PTR(mTexCoords); 28 30 } 29 31 } … … 32 34 Geometry::~Geometry() 33 35 { 34 if (mVertices) delete [] mVertices;35 if (mNormals) delete [] mNormals;36 if (mTexCoords) delete [] mTexCoords;36 DEL_ARRAY_PTR(mVertices); 37 DEL_ARRAY_PTR(mNormals); 38 DEL_ARRAY_PTR(mTexCoords); 37 39 38 40 // delete vbo … … 65 67 66 68 glGenBuffersARB(1, &mVboId); 67 68 69 glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVboId); 69 70 … … 93 94 { 94 95 glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVboId); 95 glVertexPointer(3, GL_FLOAT, 0, (char *)NULL); 96 97 if (mHasTexture) 98 glTexCoordPointer(2, GL_FLOAT, 0, (char *)NULL + 2 * mNumVertices * sizeof(Vector3)); 99 96 100 glNormalPointer(GL_FLOAT, 0, (char *)NULL + mNumVertices * sizeof(Vector3)); 97 101 98 if (mTexCoords) 99 glTexCoordPointer(2, GL_FLOAT, 0, (char *)NULL + 2 * mNumVertices * sizeof(Vector3)); 102 glVertexPointer(3, GL_FLOAT, 0, (char *)NULL); 100 103 101 104 state->SetCurrentVboId(mVboId);
Note: See TracChangeset
for help on using the changeset viewer.