Fixed conflict between VAO and OpenGL::BindBuffer

Former-commit-id: b1182e3b0327a73431a8e81106df9109e9a80cc2
This commit is contained in:
Lynix
2013-06-18 02:29:31 +02:00
parent 9e906c2568
commit 3e8ed9b1e4
3 changed files with 14 additions and 1 deletions

View File

@@ -1498,6 +1498,7 @@ bool NzRenderer::EnsureStateUpdate()
VAO_Key key(NzContext::GetCurrent(), s_indexBuffer, s_vertexBuffer, s_instancing);
auto it = s_vaos.find(key);
if (it == s_vaos.end())
{
// On créé notre VAO
@@ -1574,6 +1575,8 @@ bool NzRenderer::EnsureStateUpdate()
NzHardwareBuffer* indexBufferImpl = static_cast<NzHardwareBuffer*>(s_indexBuffer->GetBuffer()->GetImpl());
indexBufferImpl->Bind();
}
else
NzOpenGL::BindBuffer(nzBufferType_Index, 0);
}
if (s_useVertexArrayObjects)
@@ -1583,7 +1586,7 @@ bool NzRenderer::EnsureStateUpdate()
glBindVertexArray(0);
// Nous (re)bindons le VAO pour définir les attributs de vertice
glBindVertexArray(vao);
NzOpenGL::BindVertexArray(vao);
}
s_updateFlags &= ~Update_VAO;