summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/simple-cpp/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qt3d/simple-cpp/main.cpp')
-rw-r--r--examples/qt3d/simple-cpp/main.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/qt3d/simple-cpp/main.cpp b/examples/qt3d/simple-cpp/main.cpp
index 32f19c194..6b45dd1d0 100644
--- a/examples/qt3d/simple-cpp/main.cpp
+++ b/examples/qt3d/simple-cpp/main.cpp
@@ -59,9 +59,9 @@
#include <Qt3DInput/QInputAspect>
#include <Qt3DRender/QRenderAspect>
+#include <Qt3DRender/QGeometryRenderer>
#include <Qt3DExtras/QForwardRenderer>
#include <Qt3DExtras/QPhongMaterial>
-#include <Qt3DExtras/QCylinderMesh>
#include <Qt3DExtras/QSphereMesh>
#include <Qt3DExtras/QTorusMesh>
@@ -91,7 +91,9 @@ Qt3DCore::QEntity *createScene()
torusTransform->setScale3D(QVector3D(1.5, 1, 0.5));
torusTransform->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(1, 0, 0), 45.0f));
- torusEntity->addComponent(torusMesh);
+ auto renderer = new Qt3DRender::QGeometryRenderer;
+ renderer->setView(torusMesh);
+ torusEntity->addComponent(renderer);
torusEntity->addComponent(torusTransform);
torusEntity->addComponent(material);
@@ -114,7 +116,10 @@ Qt3DCore::QEntity *createScene()
sphereRotateTransformAnimation->setLoopCount(-1);
sphereRotateTransformAnimation->start();
- sphereEntity->addComponent(sphereMesh);
+ renderer = new Qt3DRender::QGeometryRenderer;
+ renderer->setView(sphereMesh);
+
+ sphereEntity->addComponent(renderer);
sphereEntity->addComponent(sphereTransform);
sphereEntity->addComponent(material);