Fix crash on nvidia linux

This commit is contained in:
vlj 2014-08-30 01:03:01 +02:00
parent fc80ebbbcb
commit af4575f6db
2 changed files with 1 additions and 22 deletions

View File

@ -113,17 +113,7 @@ void STKAnimatedMesh::update()
{
fillLocalBuffer(mesh, mb);
mesh.vao = createVAO(mesh.vertex_buffer, mesh.index_buffer, mb->getVertexType());
glGenBuffers(1, &(mesh.instance_buffer));
glBindBuffer(GL_ARRAY_BUFFER, mesh.instance_buffer);
glEnableVertexAttribArray(7);
glVertexAttribPointer(7, 3, GL_FLOAT, GL_FALSE, sizeof(InstanceData), 0);
glVertexAttribDivisor(7, 1);
glEnableVertexAttribArray(8);
glVertexAttribPointer(8, 3, GL_FLOAT, GL_FALSE, sizeof(InstanceData), (GLvoid*)(3 * sizeof(float)));
glVertexAttribDivisor(8, 1);
glEnableVertexAttribArray(9);
glVertexAttribPointer(9, 3, GL_FLOAT, GL_FALSE, sizeof(InstanceData), (GLvoid*)(6 * sizeof(float)));
glVertexAttribDivisor(9, 1);
glBindVertexArray(0);
}
}
}

View File

@ -94,17 +94,6 @@ void STKMeshSceneNode::setFirstTimeMaterial()
{
fillLocalBuffer(mesh, mb);
mesh.vao = createVAO(mesh.vertex_buffer, mesh.index_buffer, mb->getVertexType());
glGenBuffers(1, &(mesh.instance_buffer));
glBindBuffer(GL_ARRAY_BUFFER, mesh.instance_buffer);
glEnableVertexAttribArray(7);
glVertexAttribPointer(7, 3, GL_FLOAT, GL_FALSE, sizeof(InstanceData), 0);
glVertexAttribDivisor(7, 1);
glEnableVertexAttribArray(8);
glVertexAttribPointer(8, 3, GL_FLOAT, GL_FALSE, sizeof(InstanceData), (GLvoid*)(3 * sizeof(float)));
glVertexAttribDivisor(8, 1);
glEnableVertexAttribArray(9);
glVertexAttribPointer(9, 3, GL_FLOAT, GL_FALSE, sizeof(InstanceData), (GLvoid*)(6 * sizeof(float)));
glVertexAttribDivisor(9, 1);
glBindVertexArray(0);
}
}