Skip to content

Commit 272f130

Browse files
committed
glgsg: unbind buffers after draw callback
Some libraries (eg. Kivy) leave their buffers bound, so this takes care of that.
1 parent 7c0a77a commit 272f130

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

panda/src/glstuff/glGraphicsStateGuardian_src.cxx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10692,6 +10692,20 @@ reissue_transforms() {
1069210692
memset(_vertex_attrib_columns, 0, sizeof(const GeomVertexColumn *) * 32);
1069310693
#endif
1069410694

10695+
// Some libraries (Kivy) leave their buffers bound. How clumsy of them.
10696+
if (_supports_buffers) {
10697+
_glBindBuffer(GL_ARRAY_BUFFER, 0);
10698+
_glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
10699+
_current_vbuffer_index = 0;
10700+
_current_ibuffer_index = 0;
10701+
}
10702+
#ifndef OPENGLES
10703+
if (_supports_glsl) {
10704+
_glDisableVertexAttribArray(0);
10705+
_glDisableVertexAttribArray(1);
10706+
}
10707+
#endif
10708+
1069510709
// Since this is called by clear_state_and_transform(), we also should reset
1069610710
// the states that won't automatically be respecified when clearing the
1069710711
// state mask.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy