diff --git a/include/mbgl/platform/gl.hpp b/include/mbgl/platform/gl.hpp index 7dbe66778..a63dd9b1f 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 abfde0a55..40459821f 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 cc832b242..7dc8f60ae 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 8d727d351..dd35f1137 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 40fb440fb..d6a680c39 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());