summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/basicshapes-cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2016-01-17 13:54:04 +0000
committerPaul Lemire <paul.lemire@kdab.com>2016-01-18 08:31:58 +0000
commit465bbed1085c57d1209aff33ce1fbd693b4e490f (patch)
tree9320d54071bcce7315b1dc8392cd87f5e55be0cc /examples/qt3d/basicshapes-cpp
parent67f6661f41e180c1508684925930c25102596353 (diff)
Always create a QFrameGraph component and forward renderer
This will allow to easily set for e.g. clear color from a C++ app even before the window is shown. Change-Id: I343b68d2fd1a3a37f99f3437afb900597fe02390 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/basicshapes-cpp')
-rw-r--r--examples/qt3d/basicshapes-cpp/main.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/examples/qt3d/basicshapes-cpp/main.cpp b/examples/qt3d/basicshapes-cpp/main.cpp
index 586647849..90c926ac3 100644
--- a/examples/qt3d/basicshapes-cpp/main.cpp
+++ b/examples/qt3d/basicshapes-cpp/main.cpp
@@ -74,6 +74,7 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
Qt3DWindow *view = new Qt3DWindow();
+ view->defaultFramegraph()->setClearColor(QColor(QRgb(0x4d4d4f)));
QWidget *container = QWidget::createWindowContainer(view);
QSize screenSize = view->screen()->size();
container->setMinimumSize(QSize(200, 100));
@@ -106,17 +107,6 @@ int main(int argc, char **argv)
Qt3DInput::QFirstPersonCameraController *camController = new Qt3DInput::QFirstPersonCameraController(rootEntity);
camController->setCamera(cameraEntity);
- // FrameGraph
- Qt3DRender::QFrameGraph *frameGraph = new Qt3DRender::QFrameGraph();
- Qt3DRender::QForwardRenderer *forwardRenderer = new Qt3DRender::QForwardRenderer();
-
- forwardRenderer->setCamera(cameraEntity);
- forwardRenderer->setClearColor(QColor(QRgb(0x4d4d4f)));
- frameGraph->setActiveFrameGraph(forwardRenderer);
-
- // Setting the FrameGraph
- view->setFrameGraph(frameGraph);
-
// Scenemodifier
SceneModifier *modifier = new SceneModifier(rootEntity);