Debian Codegraph @

tests/manual/gltf/main.cpp

raw symbols SCIP
1 // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 #include <Qt3DQuickExtras/qt3dquickwindow.h>
5 #include <QGuiApplication>
6 #include <QOpenGLContext>
7
8 int main(int argc, char* argv[])
9 {
10 QGuiApplication app(argc, argv);
11 Qt3DExtras::Quick::Qt3DQuickWindow view;
12
13 view.setSource(QUrl("qrc:/main.qml"));
14 view.show();
15
16 const bool isES = QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES
17 || view.requestedFormat().renderableType() == QSurfaceFormat::OpenGLES;
18 if (!isES)
19 qDebug("Using a non-OpenGL ES context. This may result in no material on the model "
20 "as currently the standard glTF format only includes OpenGL ES 2.0 shaders. "
21 "To overcome this, run the application on OpenGL ES or use the qgltf tool "
22 "with -g to generate a slightly extended glTF asset from the original COLLADA source.");
23
24 return app.exec();
25 }