diff --git a/effects/demo_liquid.cpp b/effects/demo_liquid.cpp index 766a1f7d7b..45f1d6e54d 100644 --- a/effects/demo_liquid.cpp +++ b/effects/demo_liquid.cpp @@ -38,6 +38,7 @@ bool LiquidEffect::loadData() // Create texture and render target mTexture = new GLTexture(displayWidth(), displayHeight()); mTexture->setFilter(GL_LINEAR_MIPMAP_LINEAR); + mTexture->setWrapMode(GL_CLAMP); mRenderTarget = new GLRenderTarget(mTexture); if( !mRenderTarget->valid() ) diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index bb8fa17ae0..0b79f4e094 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -401,6 +401,14 @@ void GLTexture::setFilter( GLenum filter ) mFilter = filter; } +void GLTexture::setWrapMode( GLenum mode ) + { + bind(); + glTexParameteri( mTarget, GL_TEXTURE_WRAP_S, mode ); + glTexParameteri( mTarget, GL_TEXTURE_WRAP_T, mode ); + unbind(); + } + void GLTexture::setDirty() { has_valid_mipmaps = false; diff --git a/lib/kwinglutils.h b/lib/kwinglutils.h index 46086f15c0..c383606e94 100644 --- a/lib/kwinglutils.h +++ b/lib/kwinglutils.h @@ -99,6 +99,7 @@ class KWIN_EXPORT GLTexture void setTexture( GLuint texture ); void setTarget( GLenum target ); void setFilter( GLenum filter ); + void setWrapMode( GLenum mode ); virtual void setDirty(); static void initStatic();