From 6036454a20e1d75e81c354e2e4d905018070ad00 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 30 Nov 2015 02:26:59 -0400 Subject: [PATCH] Fixed up some code. --- src/modules/graphics/opengl/Canvas.cpp | 8 ++++++++ src/modules/graphics/opengl/Image.cpp | 10 +++++++++- src/modules/graphics/opengl/OpenGL.cpp | 3 --- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/modules/graphics/opengl/Canvas.cpp b/src/modules/graphics/opengl/Canvas.cpp index d173bc30b..a2904c6c9 100644 --- a/src/modules/graphics/opengl/Canvas.cpp +++ b/src/modules/graphics/opengl/Canvas.cpp @@ -361,6 +361,14 @@ bool Canvas::setWrap(const Texture::Wrap &w) wrap.s = wrap.t = WRAP_CLAMP; } + if (!gl.isClampZeroTextureWrapSupported()) + { + if (wrap.s == WRAP_CLAMP_ZERO) + wrap.s = WRAP_CLAMP; + if (wrap.t == WRAP_CLAMP_ZERO) + wrap.t = WRAP_CLAMP; + } + gl.bindTexture(texture); gl.setTextureWrap(wrap); diff --git a/src/modules/graphics/opengl/Image.cpp b/src/modules/graphics/opengl/Image.cpp index 52b1a4a20..b21fa3556 100644 --- a/src/modules/graphics/opengl/Image.cpp +++ b/src/modules/graphics/opengl/Image.cpp @@ -531,8 +531,16 @@ bool Image::setWrap(const Texture::Wrap &w) wrap.s = wrap.t = WRAP_CLAMP; } + if (!gl.isClampZeroTextureWrapSupported()) + { + if (wrap.s == WRAP_CLAMP_ZERO) + wrap.s = WRAP_CLAMP; + if (wrap.t == WRAP_CLAMP_ZERO) + wrap.t = WRAP_CLAMP; + } + gl.bindTexture(texture); - gl.setTextureWrap(w); + gl.setTextureWrap(wrap); return success; } diff --git a/src/modules/graphics/opengl/OpenGL.cpp b/src/modules/graphics/opengl/OpenGL.cpp index 72032db5a..19d9b2862 100644 --- a/src/modules/graphics/opengl/OpenGL.cpp +++ b/src/modules/graphics/opengl/OpenGL.cpp @@ -604,9 +604,6 @@ void OpenGL::setTextureFilter(graphics::Texture::Filter &f) GLint OpenGL::getGLWrapMode(Texture::WrapMode wmode) { - if (wmode == Texture::WRAP_CLAMP_ZERO && !isClampZeroTextureWrapSupported()) - wmode = Texture::WRAP_CLAMP; - switch (wmode) { case Texture::WRAP_CLAMP: