mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
OpenGL: Only use vertex arrays if the GL version is greater or equal to 3
This commit is contained in:
parent
85226c33d4
commit
90ad1877af
1 changed files with 7 additions and 3 deletions
|
|
@ -335,8 +335,9 @@ public:
|
|||
|
||||
void bindVertexArray() noexcept
|
||||
{
|
||||
if (vertexArrayObject != 0)
|
||||
context.extensions.glBindVertexArray (vertexArrayObject);
|
||||
if (openGLVersion.major >= 3)
|
||||
if (vertexArrayObject != 0)
|
||||
context.extensions.glBindVertexArray (vertexArrayObject);
|
||||
}
|
||||
|
||||
void checkViewportBounds()
|
||||
|
|
@ -534,7 +535,9 @@ public:
|
|||
|
||||
gl::loadFunctions();
|
||||
|
||||
if (OpenGLShaderProgram::getLanguageVersion() > 1.2)
|
||||
openGLVersion = getOpenGLVersion();
|
||||
|
||||
if (openGLVersion.major >= 3)
|
||||
{
|
||||
context.extensions.glGenVertexArrays (1, &vertexArrayObject);
|
||||
bindVertexArray();
|
||||
|
|
@ -671,6 +674,7 @@ public:
|
|||
OpenGLContext& context;
|
||||
Component& component;
|
||||
|
||||
Version openGLVersion;
|
||||
OpenGLFrameBuffer cachedImageFrameBuffer;
|
||||
RectangleList<int> validArea;
|
||||
Rectangle<int> viewportArea, lastScreenBounds;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue