diff options
Diffstat (limited to 'examples/qt3d/gltf/main.cpp')
-rw-r--r-- | examples/qt3d/gltf/main.cpp | 9 |
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(); } |