summaryrefslogtreecommitdiffstats
path: root/examples/opengl
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-07-01 14:40:51 +0200
committerSamuel Rødal <sroedal@trolltech.com>2009-07-01 14:44:25 +0200
commit66a281ab76303074cd9cbb6cd22dcc5f3dbe8454 (patch)
tree1f42218c513a327d85ff408297879297c78a23f1 /examples/opengl
parent7bf505a54379388b292df528114d6e2dd8d9d4d4 (diff)
Made QPainter / OpenGL intermixing in hellogl_es2 work properly again.
Need to call syncState() to let the paint engine set depth clipping state parameters back to their OpenGL defaults. Reviewed-by: Trond
Diffstat (limited to 'examples/opengl')
-rw-r--r--examples/opengl/hellogl_es2/glwidget.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/opengl/hellogl_es2/glwidget.cpp b/examples/opengl/hellogl_es2/glwidget.cpp
index 6b08662016..bb07b2223e 100644
--- a/examples/opengl/hellogl_es2/glwidget.cpp
+++ b/examples/opengl/hellogl_es2/glwidget.cpp
@@ -41,6 +41,7 @@
#include "glwidget.h"
#include <QPainter>
+#include <QPaintEngine>
#include <math.h>
#include "bubble.h"
@@ -265,6 +266,8 @@ void GLWidget::paintGL()
QPainter painter;
painter.begin(this);
+ painter.paintEngine()->syncState();
+
glClearColor(0.1f, 0.1f, 0.2f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);