really unbind vao

This commit is contained in:
milek7
2019-08-08 16:02:51 +02:00
parent 0ed35ed254
commit 540b21113e

View File

@@ -16,6 +16,7 @@ gl::vao::~vao()
if (!use_vao)
return;
unbind();
glDeleteVertexArrays(1, *this);
}
@@ -74,4 +75,11 @@ void gl::vao::bind()
void gl::vao::unbind()
{
active = nullptr;
if (use_vao) {
glBindVertexArray(0);
}
else {
for (size_t i = 0; i < 4; i++)
glDisableVertexAttribArray(i);
}
}