1
0
Fork 0
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:
reuk 2021-07-13 11:47:43 +01:00
parent 85226c33d4
commit 90ad1877af
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -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;