mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
glgsg: unbind buffers after draw callback
Some libraries (eg. Kivy) leave their buffers bound, so this takes care of that.
This commit is contained in:
parent
7c0a77af78
commit
272f13023e
@ -10692,6 +10692,20 @@ reissue_transforms() {
|
||||
memset(_vertex_attrib_columns, 0, sizeof(const GeomVertexColumn *) * 32);
|
||||
#endif
|
||||
|
||||
// Some libraries (Kivy) leave their buffers bound. How clumsy of them.
|
||||
if (_supports_buffers) {
|
||||
_glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
_glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
_current_vbuffer_index = 0;
|
||||
_current_ibuffer_index = 0;
|
||||
}
|
||||
#ifndef OPENGLES
|
||||
if (_supports_glsl) {
|
||||
_glDisableVertexAttribArray(0);
|
||||
_glDisableVertexAttribArray(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Since this is called by clear_state_and_transform(), we also should reset
|
||||
// the states that won't automatically be respecified when clearing the
|
||||
// state mask.
|
||||
|
Loading…
x
Reference in New Issue
Block a user