diff options
Diffstat (limited to 'tests/manual/planets-qml/main.cpp')
-rw-r--r-- | tests/manual/planets-qml/main.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/manual/planets-qml/main.cpp b/tests/manual/planets-qml/main.cpp new file mode 100644 index 000000000..834cc3c06 --- /dev/null +++ b/tests/manual/planets-qml/main.cpp @@ -0,0 +1,39 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QGuiApplication> +#include <QQuickView> +#include <QQmlContext> +#include <QOpenGLContext> +#include <Qt3DRender/qt3drender-config.h> + +#include "networkcontroller.h" + +int main(int argc, char **argv) +{ + QGuiApplication app(argc, argv); + + QSurfaceFormat format; + if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { + format.setVersion(4, 5); + format.setProfile(QSurfaceFormat::CoreProfile); + } + format.setDepthBufferSize(24); + format.setStencilBufferSize(8); + format.setSamples(4); +#if !QT_CONFIG(qt3d_rhi_renderer) + qputenv("QSG_RHI_BACKEND", "opengl"); +#endif + + NetworkController networkController; + + QQuickView view; + view.setFormat(format); + view.rootContext()->setContextProperty("networkController", &networkController); + view.setResizeMode(QQuickView::SizeRootObjectToView); + view.setSource(QUrl("qrc:/PlanetsMain.qml")); + view.setColor("#000000"); + view.show(); + + return app.exec(); +} |