mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix to the GL 2D renderer. Also removed the smaller limit on the GL buffer sizes used in win32.
This commit is contained in:
parent
5b25b303fb
commit
d20279d1db
2 changed files with 12 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 <ShaderPrograms*> (context.getAssociatedObject (programValueID));
|
||||
programs = static_cast<ShaderPrograms*> (context.getAssociatedObject (programValueID));
|
||||
|
||||
if (programs == nullptr)
|
||||
{
|
||||
|
|
@ -1064,11 +1060,17 @@ struct StateHelpers
|
|||
}
|
||||
}
|
||||
|
||||
~CurrentShader()
|
||||
{
|
||||
jassert (activeShader == nullptr);
|
||||
}
|
||||
|
||||
void setShader (const Rectangle<int>& bounds, ShaderQuadQueue& quadQueue, ShaderPrograms::ShaderBase& shader)
|
||||
{
|
||||
if (activeShader != &shader)
|
||||
{
|
||||
quadQueue.flush();
|
||||
clearShader (quadQueue);
|
||||
|
||||
activeShader = &shader;
|
||||
shader.program.use();
|
||||
shader.bindAttributes (context);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue