From 7421f8234a77f358479099e40ce336d1863fedb1 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 2 Sep 2009 16:26:34 +0200 Subject: Fixed rendering in boxes demo with GL2 paint engine. Added beginNativePainting() and endNativePainting() calls. Reviewed-by: Samuel --- demos/boxes/qtbox.cpp | 4 ++++ demos/boxes/scene.cpp | 3 +++ 2 files changed, 7 insertions(+) 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) -- cgit v0.12