Fix iOS compile
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user