From 2a15b88dc329bb5ebf9578392da43c61e022ef0f Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 25 May 2015 09:36:11 +0100 Subject: [PATCH] Fix for GL 2D rendering when used with user-code which unbinds the VAO. --- modules/juce_opengl/opengl/juce_OpenGLContext.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index 36937b8669..90c270c36e 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -289,6 +289,11 @@ public: glBindTexture (GL_TEXTURE_2D, cachedImageFrameBuffer.getTextureID()); + #if JUCE_OPENGL3 + if (vertexArrayObject != 0) + glBindVertexArray (vertexArrayObject); + #endif + const Rectangle cacheBounds (cachedImageFrameBuffer.getWidth(), cachedImageFrameBuffer.getHeight()); context.copyTexture (cacheBounds, cacheBounds, cacheBounds.getWidth(), cacheBounds.getHeight(), false); glBindTexture (GL_TEXTURE_2D, 0);