summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/gltf
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-20 14:59:43 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-20 13:07:54 +0000
commit052e60d67e87d40e8aea0dc132519319a5a40409 (patch)
tree1d9e856b3f11ad63ce807001213b38968d397546 /examples/qt3d/gltf
parent8213f9b513bccaa1153ba9a6234023af3841386c (diff)
gltf example: show a note to explain the lack of material on non-ES
Change-Id: Ic268445614a2d9d645029629747f5ef2e1aedc97 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/gltf')
-rw-r--r--examples/qt3d/gltf/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/qt3d/gltf/main.cpp b/examples/qt3d/gltf/main.cpp
index 1c1018404..9cd7025fa 100644
--- a/examples/qt3d/gltf/main.cpp
+++ b/examples/qt3d/gltf/main.cpp
@@ -40,6 +40,7 @@
#include <Qt3DQuick/QQmlAspectEngine>
#include <QGuiApplication>
+#include <QOpenGLContext>
#include <QtQml>
int main(int argc, char* argv[])
@@ -61,5 +62,13 @@ int main(int argc, char* argv[])
engine.setSource(QUrl("qrc:/main.qml"));
view.show();
+ const bool isES = QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES
+ || view.requestedFormat().renderableType() == QSurfaceFormat::OpenGLES;
+ if (!isES)
+ qDebug("Using a non-OpenGL ES context. This may result in no material on the model "
+ "as currently the standard glTF format only includes OpenGL ES 2.0 shaders. "
+ "To overcome this, run the application on OpenGL ES or use the qgltf tool "
+ "with -g to generate a slightly extended glTF asset from the original COLLADA source.");
+
return app.exec();
}