summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/simple-qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qt3d/simple-qml')
-rw-r--r--examples/qt3d/simple-qml/main.cpp22
-rw-r--r--examples/qt3d/simple-qml/main.qml3
2 files changed, 5 insertions, 20 deletions
diff --git a/examples/qt3d/simple-qml/main.cpp b/examples/qt3d/simple-qml/main.cpp
index 2305a685e..04fa98212 100644
--- a/examples/qt3d/simple-qml/main.cpp
+++ b/examples/qt3d/simple-qml/main.cpp
@@ -34,30 +34,14 @@
**
****************************************************************************/
-#include <window.h>
-#include <Qt3DRender/qrenderaspect.h>
-#include <Qt3DInput/QInputAspect>
-#include <Qt3DLogic/QLogicAspect>
-#include <Qt3DQuick/QQmlAspectEngine>
-
+#include "qt3dquickwindow.h"
#include <QGuiApplication>
int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
-
- Window view;
- Qt3DCore::Quick::QQmlAspectEngine engine;
-
- engine.aspectEngine()->registerAspect(new Qt3DRender::QRenderAspect());
- engine.aspectEngine()->registerAspect(new Qt3DInput::QInputAspect());
- engine.aspectEngine()->registerAspect(new Qt3DLogic::QLogicAspect());
- QVariantMap data;
- data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
- data.insert(QStringLiteral("eventSource"), QVariant::fromValue(&view));
- engine.aspectEngine()->setData(data);
- engine.setSource(QUrl("qrc:/main.qml"));
-
+ Qt3DQuickWindow view;
+ view.setSource(QUrl("qrc:/main.qml"));
view.show();
return app.exec();
diff --git a/examples/qt3d/simple-qml/main.qml b/examples/qt3d/simple-qml/main.qml
index 48db34618..9d25da81a 100644
--- a/examples/qt3d/simple-qml/main.qml
+++ b/examples/qt3d/simple-qml/main.qml
@@ -37,6 +37,7 @@
import QtQuick 2.2 as QQ2
import Qt3D.Core 2.0
import Qt3D.Render 2.0
+import Qt3D.Input 2.0
Entity {
id: sceneRoot
@@ -53,7 +54,7 @@ Entity {
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
}
- CameraController {
+ FirstPersonCameraController {
camera: camera
}