summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2014-12-02 03:43:04 +1100
committerLeith Bade <leith@mapbox.com>2014-12-02 03:43:04 +1100
commit5ad094e82352721a0ecc789fc414f3eafa40d357 (patch)
tree9f0e10095b73db8b6b25d6fef879f24890363620
parent2800f361424ee84af283fbe7bb73b5afbe264c6e (diff)
downloadqtlocation-mapboxgl-5ad094e82352721a0ecc789fc414f3eafa40d357.tar.gz
Fix iOS compile
-rw-r--r--include/mbgl/platform/gl.hpp16
-rw-r--r--src/geometry/glyph_atlas.cpp2
-rw-r--r--src/geometry/sprite_atlas.cpp2
-rw-r--r--src/renderer/prerendered_texture.cpp2
-rw-r--r--src/util/raster.cpp2
5 files changed, 20 insertions, 4 deletions
diff --git a/include/mbgl/platform/gl.hpp b/include/mbgl/platform/gl.hpp
index 7dbe667788..a63dd9b1fb 100644
--- a/include/mbgl/platform/gl.hpp
+++ b/include/mbgl/platform/gl.hpp
@@ -129,17 +129,25 @@ extern PFNGLGENVERTEXARRAYSPROC GenVertexArrays;
extern PFNGLISVERTEXARRAYPROC IsVertexArray;
-// Debug group markers, useful for debuggin on iOS
-#if __APPLE__ && defined(DEBUG) && defined(GL_EXT_debug_marker)
+// Debug group markers, useful for debugging on iOS
+#if defined(DEBUG)
// static int indent = 0;
inline void start_group(const std::string &str) {
- glPushGroupMarkerEXT(0, str.c_str());
+ if (gl::PushDebugGroup != nullptr) {
+ gl::PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, str.size(), str.c_str());
+ } else if (gl::PushGroupMarkerEXT != nullptr) {
+ gl::PushGroupMarkerEXT(str.size(), str.c_str());
+ }
// fprintf(stderr, "%s%s\n", std::string(indent * 4, ' ').c_str(), str.c_str());
// indent++;
}
inline void end_group() {
- glPopGroupMarkerEXT();
+ if (gl::PopDebugGroup != nullptr) {
+ gl::PopDebugGroup();
+ } else if (gl::PopGroupMarkerEXT != nullptr) {
+ gl::PopGroupMarkerEXT();
+ }
// indent--;
}
#else
diff --git a/src/geometry/glyph_atlas.cpp b/src/geometry/glyph_atlas.cpp
index abfde0a556..40459821fd 100644
--- a/src/geometry/glyph_atlas.cpp
+++ b/src/geometry/glyph_atlas.cpp
@@ -143,7 +143,9 @@ void GlyphAtlas::bind() {
if (!texture) {
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
+#ifndef GL_ES_VERSION_2_0
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
diff --git a/src/geometry/sprite_atlas.cpp b/src/geometry/sprite_atlas.cpp
index cc832b2421..7dc8f60ae6 100644
--- a/src/geometry/sprite_atlas.cpp
+++ b/src/geometry/sprite_atlas.cpp
@@ -201,7 +201,9 @@ void SpriteAtlas::bind(bool linear) {
if (!texture) {
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
+#ifndef GL_ES_VERSION_2_0
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
first = true;
diff --git a/src/renderer/prerendered_texture.cpp b/src/renderer/prerendered_texture.cpp
index 8d727d3511..dd35f11372 100644
--- a/src/renderer/prerendered_texture.cpp
+++ b/src/renderer/prerendered_texture.cpp
@@ -37,7 +37,9 @@ void PrerenderedTexture::bindFramebuffer() {
if (texture == 0) {
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
+#ifndef GL_ES_VERSION_2_0
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+#endif
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
diff --git a/src/util/raster.cpp b/src/util/raster.cpp
index 40fb440fb2..d6a680c391 100644
--- a/src/util/raster.cpp
+++ b/src/util/raster.cpp
@@ -48,7 +48,9 @@ void Raster::bind(bool linear) {
if (img && !textured) {
texture = texturepool.getTextureID();
glBindTexture(GL_TEXTURE_2D, texture);
+#ifndef GL_ES_VERSION_2_0
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, img->getData());