summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-08-03 17:44:59 +0100
committerMike Krus <mike.krus@kdab.com>2020-08-05 11:32:02 +0100
commit2b8eaa3350250bb7afc5105aba2da51685aaed88 (patch)
treece1efe4160f194e6a4a77c5ae0769416d460afc0 /examples
parent32e687f3a83ba85e64c0f8ef43a5e3854111ab02 (diff)
Handle backend type based on QtQuick settings
By default, Scene3D will select the RHI backend. If QQuickWindow::graphicsApi() is set to QSGRendererInterface::OpenGLRhi (QSG_RHI_BACKEND set to "opengl") then Qt3D will select the OpenGL backend. It's possible to use the OpenGL backend to RHI by setting QQuickWindow::graphicsApi() to QSGRendererInterface::OpenGLRhi AND setting QT3D_RENDERER to "rhi". (Note that setting to QSGRendererInterface::OpenGL has not effect). Change-Id: I71488ddb290ce2e30c724ddcc10c57ed8afe267b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qt3d/scene3d/AnimatedEntity.qml1
-rw-r--r--examples/qt3d/scene3d/CMakeLists.txt1
-rw-r--r--examples/qt3d/scene3d/main.cpp1
3 files changed, 2 insertions, 1 deletions
diff --git a/examples/qt3d/scene3d/AnimatedEntity.qml b/examples/qt3d/scene3d/AnimatedEntity.qml
index 02e1148e2..4c7f700cf 100644
--- a/examples/qt3d/scene3d/AnimatedEntity.qml
+++ b/examples/qt3d/scene3d/AnimatedEntity.qml
@@ -115,6 +115,7 @@ Entity {
SphereMesh {
id: sphereMesh
radius: 3
+ generateTangents: true
}
Transform {
diff --git a/examples/qt3d/scene3d/CMakeLists.txt b/examples/qt3d/scene3d/CMakeLists.txt
index 675bb53b1..9efb25713 100644
--- a/examples/qt3d/scene3d/CMakeLists.txt
+++ b/examples/qt3d/scene3d/CMakeLists.txt
@@ -40,6 +40,7 @@ qt6_add_resources(scene3d "scene3d"
FILES
${scene3d_resource_files}
)
+target_sources(scene3d PRIVATE ${scene3d_resource_files})
install(TARGETS scene3d
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/qt3d/scene3d/main.cpp b/examples/qt3d/scene3d/main.cpp
index 11d07c024..f4f01a7ea 100644
--- a/examples/qt3d/scene3d/main.cpp
+++ b/examples/qt3d/scene3d/main.cpp
@@ -70,7 +70,6 @@ int main(int argc, char **argv)
QGuiApplication app(argc, argv);
// Force OpenGL backend
- QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
QQuickView view;
view.resize(1024, 768);