diff options
author | Anton Romanov <theli.ua@gmail.com> | 2010-04-18 04:04:16 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2010-04-18 04:04:16 +0400 |
commit | ec7e78d1754e587b89a1de27e959af9831c226ef (patch) | |
tree | 93a54445a583c740adda8dc0bdc7fabcaf6b848f /overlay_gl | |
parent | 372f763675c93f98c5fc839c62a463b98ef2cd75 (diff) |
in case GL_ARRAY_BUFFER is bound, store and reset it before rendering overlay and restore after
Diffstat (limited to 'overlay_gl')
-rw-r--r-- | overlay_gl/overlay.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/overlay_gl/overlay.c b/overlay_gl/overlay.c index 44def7e58..82bec052b 100644 --- a/overlay_gl/overlay.c +++ b/overlay_gl/overlay.c @@ -516,16 +516,21 @@ static void drawContext(Context * ctx, int width, int height) { glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); - int bound = 0; + GLint bound = 0, vbobound = 0; glGetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, &bound); + glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &vbobound); if (bound != 0) glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + if (vbobound != 0) + glBindBuffer(GL_ARRAY_BUFFER, 0); drawOverlay(ctx, width, height); if (bound != 0) glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, bound); + if (vbobound != 0) + glBindBuffer(GL_ARRAY_BUFFER, vbobound); glMatrixMode(GL_TEXTURE); glPopMatrix(); |