Browse Source

OpenGL: Ensure a VAO is bound before calling user render callback

v7.0.9
reuk 2 years ago
parent
commit
17deafbb0d
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
2 changed files with 3 additions and 4 deletions
  1. +1
    -0
      examples/GUI/OpenGLDemo.h
  2. +2
    -4
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp

+ 1
- 0
examples/GUI/OpenGLDemo.h View File

@@ -763,6 +763,7 @@ public:
controlsOverlay.reset (new DemoControlsOverlay (*this));
addAndMakeVisible (controlsOverlay.get());
openGLContext.setOpenGLVersionRequired (OpenGLContext::openGL3_2);
openGLContext.setRenderer (this);
openGLContext.attachTo (*this);
openGLContext.setContinuousRepainting (true);


+ 2
- 4
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -195,9 +195,6 @@ public:
if (context.renderer != nullptr)
context.renderer->openGLContextClosing();
if (vertexArrayObject != 0)
context.extensions.glDeleteVertexArrays (1, &vertexArrayObject);
associatedObjectNames.clear();
associatedObjects.clear();
cachedImageFrameBuffer.release();
@@ -400,6 +397,8 @@ public:
if (context.renderer != nullptr)
{
OpenGLRendering::SavedBinding<OpenGLRendering::TraitsVAO> vaoBinding;
glViewport (0, 0, viewportArea.getWidth(), viewportArea.getHeight());
context.currentRenderScale = currentAreaAndScale.scale;
context.renderer->renderOpenGL();
@@ -955,7 +954,6 @@ public:
RectangleList<int> validArea;
Rectangle<int> lastScreenBounds;
AffineTransform transform;
GLuint vertexArrayObject = 0;
LockedAreaAndScale areaAndScale;
StringArray associatedObjectNames;


Loading…
Cancel
Save