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.
This commit is contained in:
Martin Gräßlin 2011-04-29 10:47:56 +02:00
parent 982f041204
commit fda841787f

View file

@ -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);
}
//--------------------------