From fda841787fb3254b55aa5736c36caba9de2d63f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 29 Apr 2011 10:47:56 +0200 Subject: [PATCH] Make Logout Effect work again with OpenGL 2 backend It's more of a hack, but at least it is working again. Still needs a proper rewrite to also support GLES. --- effects/logout/logout.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp index 9e533da016..d0a5c1dc28 100644 --- a/effects/logout/logout.cpp +++ b/effects/logout/logout.cpp @@ -215,6 +215,12 @@ void LogoutEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) //-------------------------- // Render the screen effect + // HACK: the GL code is still OpenGL 1, so we have to unbind the shader. + GLint shader = 0; + if (ShaderManager::instance()->isShaderBound()) { + glGetIntegerv(GL_CURRENT_PROGRAM, &shader); + glUseProgram(0); + } glPushAttrib(GL_CURRENT_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT); // Unmodified base image @@ -255,6 +261,10 @@ void LogoutEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) renderVignetting(); glPopAttrib(); + // HACK: rebind previously bound shader + if (ShaderManager::instance()->isShaderBound()) { + glUseProgram(shader); + } //--------------------------