mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Made the GL demo page clean up its attributes to avoid problems on nvideo cards.
This commit is contained in:
parent
9bba8bae5e
commit
b7ebb273d9
1 changed files with 9 additions and 1 deletions
|
|
@ -82,6 +82,14 @@ struct OpenGLDemoClasses
|
|||
}
|
||||
}
|
||||
|
||||
void disable (OpenGLContext& openGLContext)
|
||||
{
|
||||
if (position != nullptr) openGLContext.extensions.glDisableVertexAttribArray (position->attributeID);
|
||||
if (normal != nullptr) openGLContext.extensions.glDisableVertexAttribArray (normal->attributeID);
|
||||
if (sourceColour != nullptr) openGLContext.extensions.glDisableVertexAttribArray (sourceColour->attributeID);
|
||||
if (texureCoordIn != nullptr) openGLContext.extensions.glDisableVertexAttribArray (texureCoordIn->attributeID);
|
||||
}
|
||||
|
||||
ScopedPointer<OpenGLShaderProgram::Attribute> position, normal, sourceColour, texureCoordIn;
|
||||
|
||||
private:
|
||||
|
|
@ -145,8 +153,8 @@ struct OpenGLDemoClasses
|
|||
vertexBuffer.bind();
|
||||
|
||||
attributes.enable (openGLContext);
|
||||
|
||||
glDrawElements (GL_TRIANGLES, vertexBuffer.numIndices, GL_UNSIGNED_INT, 0);
|
||||
attributes.disable (openGLContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue