[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/libs/kgllib/extras/kgllib
From:       Rivo Laks <rivolaks () hot ! ee>
Date:       2008-09-07 14:40:06
Message-ID: 1220798406.916962.28714.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 858179 by rivol:

- Save the OpenGL state before calling GLWidget::paintGL() to protect QPainter from state changes
  made by the GLWidget.
- Set blending attributes to default values before calling GLWidget::paintGL(). This fixes long-standing
  problems with bloom in HdrGLWidget/Astrododge.

 M  +10 -0     widgetproxy.cpp  


--- trunk/playground/libs/kgllib/extras/kgllib/widgetproxy.cpp #858178:858179
@@ -50,7 +50,17 @@
             //qDebug() << "GL isn't initialized";
             return;
         }
+        // Push all attributes to protect QPainter against any state changes
+        //  made by GLWidget::paintGL()
+        glPushAttrib(GL_ALL_ATTRIB_BITS);
+        // Set blending attributes to default values
+        glDisable(GL_BLEND);
+        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
         mGLWidget->paintGL();
+
+        // Pop the state
+        glPopAttrib();
         // paintGL() might change the matrices so we load the same ones as
         //  the OpenGL paintengine does
         glMatrixMode(GL_PROJECTION);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic