summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-09-02 14:26:34 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-09-02 14:28:58 (GMT)
commit7421f8234a77f358479099e40ce336d1863fedb1 (patch)
tree201a6b6dbde99bd210e585c9c30d7f024690c8f2 /demos
parent0f06310ad141fb3705cb5180db700aa82a155287 (diff)
downloadQt-7421f8234a77f358479099e40ce336d1863fedb1.zip
Qt-7421f8234a77f358479099e40ce336d1863fedb1.tar.gz
Qt-7421f8234a77f358479099e40ce336d1863fedb1.tar.bz2
Fixed rendering in boxes demo with GL2 paint engine.
Added beginNativePainting() and endNativePainting() calls. Reviewed-by: Samuel
Diffstat (limited to 'demos')
-rw-r--r--demos/boxes/qtbox.cpp4
-rw-r--r--demos/boxes/scene.cpp3
2 files changed, 7 insertions, 0 deletions
diff --git a/demos/boxes/qtbox.cpp b/demos/boxes/qtbox.cpp
index 54882fb..7134d63 100644
--- a/demos/boxes/qtbox.cpp
+++ b/demos/boxes/qtbox.cpp
@@ -319,6 +319,8 @@ void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi
0.5f * (right + left), 0.5f * (bottom + top), 0.0f, 1.0f
};
+ painter->beginNativePainting();
+
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadMatrixf(moveToRectMatrix);
@@ -392,6 +394,8 @@ void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi
glMatrixMode(GL_PROJECTION);
glPopMatrix();
+ painter->endNativePainting();
+
ItemBase::paint(painter, option, widget);
}
diff --git a/demos/boxes/scene.cpp b/demos/boxes/scene.cpp
index 016ba17..2a7ca0e 100644
--- a/demos/boxes/scene.cpp
+++ b/demos/boxes/scene.cpp
@@ -894,6 +894,7 @@ void Scene::drawBackground(QPainter *painter, const QRectF &)
float width = float(painter->device()->width());
float height = float(painter->device()->height());
+ painter->beginNativePainting();
setStates();
if (m_dynamicCubemap)
@@ -913,6 +914,8 @@ void Scene::drawBackground(QPainter *painter, const QRectF &)
defaultStates();
++m_frame;
+
+ painter->endNativePainting();
}
QPointF Scene::pixelPosToViewPos(const QPointF& p)