From d12c4e58fd512d2b5bc61079a9db6dac2d94e185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 5 Dec 2010 10:51:51 +0100 Subject: [PATCH] Support new translate for textures --- lib/kwinglutils.cpp | 5 ++++- scene_opengl.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index 8ab363f5cf..8b1311b0b5 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -525,7 +525,10 @@ void GLTexture::render( QRegion region, const QRect& rect, bool useShader ) m_vbo->setData( 4, 2, verts, texcoords ); } if (useShader) { - // TODO: set shader translation. + GLint currentProgram; + glGetIntegerv( GL_CURRENT_PROGRAM, ¤tProgram ); + GLint location = glGetUniformLocation(currentProgram, "geometry"); + glUniform4f(location, rect.x(), rect.y(), 0.0f, 0.0f); } else { #ifndef KWIN_HAVE_OPENGLES glTranslatef( rect.x(), rect.y(), 0.0f ); diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 7e0aab13dc..7ed965a042 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1362,7 +1362,7 @@ void SceneOpenGL::EffectFrame::render( QRegion region, double opacity, double fr m_unstyledTexture->bind(); const QPoint pt = m_effectFrame->geometry().topLeft(); if (sceneShader) { - // TODO: move geometry + shader->setUniform("geometry", QVector4D(pt.x(), pt.y(), 0.0f, 0.0f)); } else { #ifndef KWIN_HAVE_OPENGLES glTranslatef( pt.x(), pt.y(), 0.0f );