diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index eca93a789e..899fc31b7c 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -1547,17 +1547,12 @@ void GLVertexBufferPrivate::corePainting( const QRegion& region, GLenum primitiv glEnableVertexAttribArray( 1 ); } - // TODO: have this information available somewhere useable - GLint currentProgram; - glGetIntegerv( GL_CURRENT_PROGRAM, ¤tProgram ); - GLint vertexAttrib = glGetAttribLocation( currentProgram, "vertex" ); - GLint texAttrib = glGetAttribLocation( currentProgram, "texCoord" ); + GLShader *shader = ShaderManager::instance()->getBoundShader(); + GLint vertexAttrib = shader->attributeLocation("vertex"); + GLint texAttrib = shader->attributeLocation("texCoord" ); if (useColor) { - GLint colorLocation = glGetUniformLocation(currentProgram, "geometryColor"); - if (colorLocation != 0) { - glUniform4f(colorLocation, color.redF(), color.greenF(), color.blueF(), color.alphaF()); - } + shader->setUniform("geometryColor", color); } glBindBuffer( GL_ARRAY_BUFFER, buffers[ 0 ] );