From af4575f6db5f8835b0370d89f2e2f130e48acd2a Mon Sep 17 00:00:00 2001 From: vlj Date: Sat, 30 Aug 2014 01:03:01 +0200 Subject: [PATCH] Fix crash on nvidia linux --- src/graphics/stkanimatedmesh.cpp | 12 +----------- src/graphics/stkmeshscenenode.cpp | 11 ----------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/graphics/stkanimatedmesh.cpp b/src/graphics/stkanimatedmesh.cpp index ba5d15c17..04d3128bd 100644 --- a/src/graphics/stkanimatedmesh.cpp +++ b/src/graphics/stkanimatedmesh.cpp @@ -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); } } } diff --git a/src/graphics/stkmeshscenenode.cpp b/src/graphics/stkmeshscenenode.cpp index 6e5aad50d..139efb912 100644 --- a/src/graphics/stkmeshscenenode.cpp +++ b/src/graphics/stkmeshscenenode.cpp @@ -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); } }