From 746358b723bdb1ed71584d6fd28f783feb434aef Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 9 Feb 2020 23:53:24 +0200 Subject: [PATCH] Don't call glVertexAttribDivisor if the extension is not available --- source/vertexsetup.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/vertexsetup.cpp b/source/vertexsetup.cpp index 7cfc1b6d..19edfb39 100644 --- a/source/vertexsetup.cpp +++ b/source/vertexsetup.cpp @@ -126,7 +126,8 @@ void VertexSetup::update_vertex_array(const VertexArray &array, unsigned binding glVertexAttribPointer(t, 4, GL_UNSIGNED_BYTE, true, stride, reinterpret_cast(offset)); else glVertexAttribPointer(t, sz, GL_FLOAT, false, stride, reinterpret_cast(offset)); - glVertexAttribDivisor(t, divisor); + if(ARB_instanced_arrays) + glVertexAttribDivisor(t, divisor); glEnableVertexAttribArray(t); } offset += sz*sizeof(float); -- 2.45.2