mirror of
https://github.com/glest/glest-source.git
synced 2025-08-23 16:32:53 +02:00
- discovered a possible bug that may have caused people with valid VBO support to crash, this fix may resolve that issue.
This commit is contained in:
@@ -141,28 +141,28 @@ void Mesh::BuildVBOs() {
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBOVertices ); // Bind The Buffer
|
||||
// Load The Data
|
||||
glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec3f)*frameCount*vertexCount, getInterpolationData()->getVertices(), GL_STATIC_DRAW_ARB );
|
||||
glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||
|
||||
// Generate And Bind The Texture Coordinate Buffer
|
||||
glGenBuffersARB( 1, (GLuint*)&m_nVBOTexCoords ); // Get A Valid Name
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBOTexCoords ); // Bind The Buffer
|
||||
// Load The Data
|
||||
glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec2f)*vertexCount, texCoords, GL_STATIC_DRAW_ARB );
|
||||
glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||
|
||||
// Generate And Bind The Normal Buffer
|
||||
glGenBuffersARB( 1, (GLuint*)&m_nVBONormals ); // Get A Valid Name
|
||||
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBONormals ); // Bind The Buffer
|
||||
// Load The Data
|
||||
glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec3f)*frameCount*vertexCount, getInterpolationData()->getNormals(), GL_STATIC_DRAW_ARB );
|
||||
glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||
|
||||
// Generate And Bind The Index Buffer
|
||||
glGenBuffersARB( 1, (GLuint*)&m_nVBOIndexes ); // Get A Valid Name
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, m_nVBOIndexes ); // Bind The Buffer
|
||||
// Load The Data
|
||||
glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER_ARB, sizeof(uint32)*indexCount, indices, GL_STATIC_DRAW_ARB );
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
|
||||
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
|
||||
|
||||
// Our Copy Of The Data Is No Longer Necessary, It Is Safe In The Graphics Card
|
||||
delete [] vertices; vertices = NULL;
|
||||
|
Reference in New Issue
Block a user