[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kwin_composite
From:       Rivo Laks <rivolaks () hot ! ee>
Date:       2007-04-28 12:25:55
Message-ID: 1177763155.032736.7424.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 658748 by rivol:

Add GLTexture::setWrapMode() call to set texture's OpenGL wrap mode.
Liquid demo effect now sets wrap mode to CLAMP to ensure that the texture won't wrap at edges
  of the screen, which would make other side of the screen visible there.

 M  +1 -0      effects/demo_liquid.cpp  
 M  +8 -0      lib/kwinglutils.cpp  
 M  +1 -0      lib/kwinglutils.h  


--- branches/work/kwin_composite/effects/demo_liquid.cpp #658747:658748
@@ -38,6 +38,7 @@
     // 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() )
--- branches/work/kwin_composite/lib/kwinglutils.cpp #658747:658748
@@ -401,6 +401,14 @@
     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;
--- branches/work/kwin_composite/lib/kwinglutils.h #658747:658748
@@ -99,6 +99,7 @@
         void setTexture( GLuint texture );
         void setTarget( GLenum target );
         void setFilter( GLenum filter );
+        void setWrapMode( GLenum mode );
         virtual void setDirty();
 
         static void initStatic();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic