summaryrefslogtreecommitdiffstats
path: root/examples/torus-cpp/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/torus-cpp/main.cpp')
-rw-r--r--examples/torus-cpp/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/torus-cpp/main.cpp b/examples/torus-cpp/main.cpp
index 330700d4c..4ca4a3df8 100644
--- a/examples/torus-cpp/main.cpp
+++ b/examples/torus-cpp/main.cpp
@@ -46,6 +46,8 @@
#include <Qt3DCore/qentity.h>
#include <Qt3DCore/qcameralens.h>
+#include <Qt3DInput/QInputAspect>
+
#include <Qt3DRenderer/qtorusmesh.h>
#include <Qt3DRenderer/qmesh.h>
#include <Qt3DRenderer/qtechnique.h>
@@ -72,6 +74,8 @@ int main(int argc, char **argv)
Qt3D::Window view;
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
+ Qt3D::QInputAspect *input = new Qt3D::QInputAspect;
+ engine.registerAspect(input);
engine.initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
@@ -89,7 +93,7 @@ int main(int argc, char **argv)
cameraEntity->setPosition(QVector3D(0, 0, -20.0f));
cameraEntity->setUpVector(QVector3D(0, 1, 0));
cameraEntity->setViewCenter(QVector3D(0, 0, 0));
- view.setCamera(cameraEntity);
+ input->setCamera(cameraEntity);
// FrameGraph
Qt3D::QFrameGraph *frameGraph = new Qt3D::QFrameGraph();