diff --git a/extras/Demo/Source/Demos/OpenGLDemo.cpp b/extras/Demo/Source/Demos/OpenGLDemo.cpp index 7aff337461..1b603a71c3 100644 --- a/extras/Demo/Source/Demos/OpenGLDemo.cpp +++ b/extras/Demo/Source/Demos/OpenGLDemo.cpp @@ -659,13 +659,13 @@ struct OpenGLDemoClasses shader->use(); if (uniforms->projectionMatrix != nullptr) - uniforms->projectionMatrix->setMatrix4 (getProjectionMatrix().mat, 1, 0); + uniforms->projectionMatrix->setMatrix4 (getProjectionMatrix().mat, 1, false); if (uniforms->viewMatrix != nullptr) - uniforms->viewMatrix->setMatrix4 (getViewMatrix().mat, 1, 0); + uniforms->viewMatrix->setMatrix4 (getViewMatrix().mat, 1, false); if (uniforms->texture != nullptr) - uniforms->texture->set (0); + uniforms->texture->set ((GLint) 0); if (uniforms->lightPosition != nullptr) uniforms->lightPosition->set (-15.0f, 10.0f, 15.0f, 0.0f); @@ -679,7 +679,7 @@ struct OpenGLDemoClasses openGLContext.extensions.glBindBuffer (GL_ARRAY_BUFFER, 0); openGLContext.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0); - if (! isMouseButtonDownAnywhere()) + if (! controlsOverlay->isMouseButtonDown()) rotation += (float) rotationSpeed; } diff --git a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp index 5c921dea54..a62b6f3de3 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp @@ -1023,11 +1023,7 @@ struct StateHelpers GLuint colour; }; - #if JUCE_MAC || JUCE_ANDROID || JUCE_IOS enum { numQuads = 256 }; - #else - enum { numQuads = 64 }; // (had problems with my drivers segfaulting when these buffers are any larger) - #endif GLuint buffers[2]; VertexInfo vertexData [numQuads * 4]; @@ -1055,7 +1051,7 @@ struct StateHelpers : context (c), activeShader (nullptr) { const char programValueID[] = "GraphicsContextPrograms"; - programs = static_cast (context.getAssociatedObject (programValueID)); + programs = static_cast (context.getAssociatedObject (programValueID)); if (programs == nullptr) { @@ -1064,11 +1060,17 @@ struct StateHelpers } } + ~CurrentShader() + { + jassert (activeShader == nullptr); + } + void setShader (const Rectangle& bounds, ShaderQuadQueue& quadQueue, ShaderPrograms::ShaderBase& shader) { if (activeShader != &shader) { - quadQueue.flush(); + clearShader (quadQueue); + activeShader = &shader; shader.program.use(); shader.bindAttributes (context);