if (gl->GenVertexArrays) {
_bind_buffer (cube_filter);
+ gl->BindBuffer (GL_ARRAY_BUFFER, 0);
}
}
gl->GenBuffers (1, &gl_sink->vertex_buffer);
_bind_buffer (gl_sink);
- if (gl->GenVertexArrays)
+ if (gl->GenVertexArrays) {
gl->BindVertexArray (0);
+ gl->BindBuffer (GL_ARRAY_BUFFER, 0);
+ } else {
+ _unbind_buffer (gl_sink);
+ }
}
static void
gl_sink->redisplay_shader = NULL;
}
- if (gl_sink->vao)
+ if (gl_sink->vao) {
gl->DeleteVertexArrays (1, &gl_sink->vao);
+ gl_sink->vao = 0;
+ }
}
static void
if (overlay->geometry_change)
_bind_buffer (overlay, overlay->overlay_vbo);
gl->BindVertexArray (overlay->overlay_vao);
+ gl->BindBuffer (GL_ARRAY_BUFFER, 0);
} else {
_bind_buffer (overlay, overlay->overlay_vbo);
}
gl->BufferData (GL_ARRAY_BUFFER, 4 * 6 * sizeof (GLfloat), vertices,
GL_STATIC_DRAW);
-
- gl->BindBuffer (GL_ARRAY_BUFFER, 0);
}
static void
if (gl->GenVertexArrays)
gl->BindVertexArray (transformation->vao);
- if (transformation->caps_change)
+ if (transformation->caps_change) {
_upload_vertices (transformation);
+ _bind_buffer (transformation);
- if (!gl->GenVertexArrays || transformation->caps_change)
+ if (gl->GenVertexArrays)
+ gl->BindBuffer (GL_ARRAY_BUFFER, 0);
+ } else if (!gl->GenVertexArrays) {
_bind_buffer (transformation);
+ }
gl->DrawElements (GL_TRIANGLE_STRIP, 5, GL_UNSIGNED_SHORT, indices);
if (gl->GenVertexArrays)
gl->BindVertexArray (0);
- else
- gl->BindBuffer (GL_ARRAY_BUFFER, 0);
+ gl->BindBuffer (GL_ARRAY_BUFFER, 0);
gl->BindTexture (GL_TEXTURE_2D, 0);
gl->Disable (GL_BLEND);
if (gl->GenVertexArrays) {
_bind_buffer (filter);
+ gl->BindBuffer (GL_ARRAY_BUFFER, 0);
}
}