diff --git a/src/Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp b/src/Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp index 0a014fb6a..7ca2b4984 100644 --- a/src/Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp +++ b/src/Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp @@ -281,6 +281,8 @@ namespace opengl { glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GLint(_parameters.minFilter)); (*m_texparams)[u32(_parameters.handle)].minFilter = GLint(_parameters.minFilter); } + +#if !defined(IOS) && !defined(EMSCRIPTEN) if (_parameters.wrapS.isValid() && !(iterValid && iter->second.wrapS == GLint(_parameters.wrapS))) { glTexParameteri(target, GL_TEXTURE_WRAP_S, GLint(_parameters.wrapS)); (*m_texparams)[u32(_parameters.handle)].wrapS = GLint(_parameters.wrapS); @@ -289,6 +291,13 @@ namespace opengl { glTexParameteri(target, GL_TEXTURE_WRAP_T, GLint(_parameters.wrapT)); (*m_texparams)[u32(_parameters.handle)].wrapT = GLint(_parameters.wrapT); } +#else // !IOS && !EMSCRIPTEN + // HACK: Emscripten & IOS only support NPOT textures for GL_CLAMP_TO_EDGE + glTexParameteri(target, GL_TEXTURE_WRAP_S, GLint(graphics::textureParameters::WRAP_CLAMP_TO_EDGE)); + (*m_texparams)[u32(_parameters.handle)].wrapS = GLint(graphics::textureParameters::WRAP_CLAMP_TO_EDGE); + glTexParameteri(target, GL_TEXTURE_WRAP_T, GLint(graphics::textureParameters::WRAP_CLAMP_TO_EDGE)); + (*m_texparams)[u32(_parameters.handle)].wrapT = GLint(graphics::textureParameters::WRAP_CLAMP_TO_EDGE); +#endif // IOS || EMSCRIPTEN if (m_supportMipmapLevel && _parameters.maxMipmapLevel.isValid() && !(iterValid && iter->second.maxMipmapLevel == GLint(_parameters.maxMipmapLevel))) { glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, GLint(_parameters.maxMipmapLevel)); (*m_texparams)[u32(_parameters.handle)].maxMipmapLevel = GLint(_parameters.maxMipmapLevel);