diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index e3654cf299..aee9ad8ca4 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -99,6 +99,8 @@ CubeEffect::CubeEffect() m_reflectionShader = ShaderManager::instance()->loadFragmentShader(ShaderManager::GenericShader, fragmentshader); const QString capshader = KGlobal::dirs()->findResource("data", "kwin/cube-cap.glsl"); m_capShader = ShaderManager::instance()->loadFragmentShader(ShaderManager::GenericShader, capshader); + m_textureMirrorMatrix.scale(1.0, -1.0, 1.0); + m_textureMirrorMatrix.translate(0.0, -1.0, 0.0); reconfigure( ReconfigureAll ); } @@ -819,11 +821,8 @@ void CubeEffect::paintCap(bool frontFirst, float zOffset) #ifndef KWIN_HAVE_OPENGLES glMatrixMode( GL_TEXTURE ); #endif - QMatrix4x4 textureMirrorMatrix; - textureMirrorMatrix.scale(1.0, -1.0, 1.0); - textureMirrorMatrix.translate(0.0, -1.0, 0.0); pushMatrix(); - loadMatrix(textureMirrorMatrix); + loadMatrix(m_textureMirrorMatrix); #ifndef KWIN_HAVE_OPENGLES glMatrixMode( GL_MODELVIEW ); diff --git a/effects/cube/cube.h b/effects/cube/cube.h index 1a546f38c0..71c4bc321e 100644 --- a/effects/cube/cube.h +++ b/effects/cube/cube.h @@ -167,6 +167,7 @@ class CubeEffect QMatrix4x4 m_rotationMatrix; QMatrix4x4 m_reflectionMatrix; + QMatrix4x4 m_textureMirrorMatrix; GLVertexBuffer *m_cubeCapBuffer; // Shortcuts - needed to toggle the effect