2022-06-08 12:47:24 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
2024-02-23 14:41:04 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2016-05-31 12:22:15 +00:00
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
|
|
|
|
#include <QtQuick/QQuickView>
|
|
|
|
#include <Qt3DQuick/QQmlAspectEngine>
|
|
|
|
#include <QQmlContext>
|
|
|
|
#include <QOpenGLContext>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
|
|
|
|
QSurfaceFormat format;
|
|
|
|
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
|
|
|
|
format.setVersion(3, 2);
|
|
|
|
format.setProfile(QSurfaceFormat::CoreProfile);
|
|
|
|
}
|
|
|
|
format.setDepthBufferSize(24);
|
|
|
|
format.setStencilBufferSize(8);
|
|
|
|
format.setSamples(4);
|
|
|
|
|
|
|
|
QQuickView view;
|
|
|
|
view.setFormat(format);
|
|
|
|
view.setResizeMode(QQuickView::SizeRootObjectToView);
|
|
|
|
view.setSource(QUrl("qrc:/main.qml"));
|
|
|
|
view.setColor("#000000");
|
|
|
|
view.show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|