summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-09-29 12:15:36 +0200
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-09-29 10:17:47 -0700
commit15aece8a30dcc1f1f97e28180edda46d05641a2d (patch)
tree51284a75c6aa16614192988641ce71f59c794dd8 /src/mbgl/gl/context.cpp
parentd1a84d9b51a7145f9f7665805cf71050aac7bc63 (diff)
downloadqtlocation-mapboxgl-15aece8a30dcc1f1f97e28180edda46d05641a2d.tar.gz
[core] introduces types for GL objects
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r--src/mbgl/gl/context.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index e70affd0b3..0d67164870 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -3,6 +3,14 @@
namespace mbgl {
namespace gl {
+static_assert(std::is_same<ProgramID, GLuint>::value, "OpenGL type mismatch");
+static_assert(std::is_same<ShaderID, GLuint>::value, "OpenGL type mismatch");
+static_assert(std::is_same<BufferID, GLuint>::value, "OpenGL type mismatch");
+static_assert(std::is_same<TextureID, GLuint>::value, "OpenGL type mismatch");
+static_assert(std::is_same<VertexArrayID, GLuint>::value, "OpenGL type mismatch");
+static_assert(std::is_same<FramebufferID, GLuint>::value, "OpenGL type mismatch");
+static_assert(std::is_same<RenderbufferID, GLuint>::value, "OpenGL type mismatch");
+
Context::~Context() {
reset();
}
@@ -60,7 +68,7 @@ void Context::setDirtyState() {
}
void Context::performCleanup() {
- for (GLuint id : abandonedPrograms) {
+ for (auto id : abandonedPrograms) {
if (program == id) {
program.setDirty();
}
@@ -68,7 +76,7 @@ void Context::performCleanup() {
}
abandonedPrograms.clear();
- for (GLuint id : abandonedShaders) {
+ for (auto id : abandonedShaders) {
MBGL_CHECK_ERROR(glDeleteShader(id));
}
abandonedShaders.clear();