| 1 | // Copyright (C) 2017 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #include <QGuiApplication> |
| 5 | |
| 6 | #include <QtQuick/QQuickView> |
| 7 | #include <Qt3DQuick/QQmlAspectEngine> |
| 8 | #include <QQmlContext> |
| 9 | #include <QOpenGLContext> |
| 10 | |
| 11 | int main(int argc, char *argv[]) |
| 12 | { |
| 13 | QGuiApplication app(argc, argv); |
| 14 | |
| 15 | QSurfaceFormat format; |
| 16 | if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { |
| 17 | format.setVersion(3, 2); |
| 18 | format.setProfile(QSurfaceFormat::CoreProfile); |
| 19 | } |
| 20 | format.setDepthBufferSize(24); |
| 21 | format.setStencilBufferSize(8); |
| 22 | format.setSamples(4); |
| 23 | |
| 24 | QQuickView view; |
| 25 | view.setFormat(format); |
| 26 | view.setResizeMode(QQuickView::SizeRootObjectToView); |
| 27 | view.setSource(QUrl("qrc:/main.qml")); |
| 28 | view.setColor("#000000"); |
| 29 | view.show(); |
| 30 | |
| 31 | return app.exec(); |
| 32 | } |