summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-05-18 16:33:54 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-05-18 16:47:20 -0700
commit63ea3d4befe7f2a8958cf3496d31d2a71561801b (patch)
tree3882de01bdae893ea4f0896786a4cfb86548449f /src
parent4af4c817f1367b9a18e63ca37cb1d7a97c1aba19 (diff)
downloadqtlocation-mapboxgl-63ea3d4befe7f2a8958cf3496d31d2a71561801b.tar.gz
Don't crash if VAO extensions are not available
Fixes #1585
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/geometry/vao.cpp5
-rw-r--r--src/mbgl/geometry/vao.hpp2
-rw-r--r--src/mbgl/renderer/painter.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/mbgl/geometry/vao.cpp b/src/mbgl/geometry/vao.cpp
index 4f6e89332f..440e48c578 100644
--- a/src/mbgl/geometry/vao.cpp
+++ b/src/mbgl/geometry/vao.cpp
@@ -31,8 +31,9 @@ static gl::ExtensionFunction<
{"GL_APPLE_vertex_array_object", "glGenVertexArraysAPPLE"}
});
-void VertexArrayObject::Bind(GLuint array) {
- MBGL_CHECK_ERROR(BindVertexArray(array));
+void VertexArrayObject::Unbind() {
+ if (!BindVertexArray) return;
+ MBGL_CHECK_ERROR(BindVertexArray(0));
}
void VertexArrayObject::Delete(GLsizei n, const GLuint* arrays) {
diff --git a/src/mbgl/geometry/vao.hpp b/src/mbgl/geometry/vao.hpp
index e35fcc9bf8..e512a3e480 100644
--- a/src/mbgl/geometry/vao.hpp
+++ b/src/mbgl/geometry/vao.hpp
@@ -11,7 +11,7 @@ namespace mbgl {
class VertexArrayObject : public util::noncopyable {
public:
- static void Bind(GLuint array);
+ static void Unbind();
static void Delete(GLsizei n, const GLuint* arrays);
VertexArrayObject();
diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp
index 653bae0d68..bcbb75e69a 100644
--- a/src/mbgl/renderer/painter.cpp
+++ b/src/mbgl/renderer/painter.cpp
@@ -263,7 +263,7 @@ void Painter::render(const Style& style, TransformState state_, TimePoint time)
const gl::debugging::group _("cleanup");
MBGL_CHECK_ERROR(glBindTexture(GL_TEXTURE_2D, 0));
- MBGL_CHECK_ERROR(VertexArrayObject::Bind(0));
+ MBGL_CHECK_ERROR(VertexArrayObject::Unbind());
}
}