Big bang
This commit is contained in:
36
src/main.cpp
Normal file
36
src/main.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <Corrade/Containers/Optional.h>
|
||||
#include <Magnum/GL/Framebuffer.h>
|
||||
#include <Magnum/Platform/GLContext.h>
|
||||
|
||||
#include "magnum_item.h"
|
||||
#include "glclampf.h"
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
// Enable AA
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QGuiApplication::setAttribute(Qt::AA_UseOpenGLES);
|
||||
|
||||
// Initialize Qt application
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
// Enable logging
|
||||
QLoggingCategory::setFilterRules("qt.scenegraph.general=true");
|
||||
|
||||
// Manually register custom types
|
||||
qmlRegisterType<MagnumItem>("Magnum", 1, 0, "Magnum");
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
const QUrl url(QStringLiteral("qrc:/main.qml"));
|
||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
||||
&app, [url](QObject *obj, const QUrl &objUrl) {
|
||||
if (!obj && url == objUrl)
|
||||
QCoreApplication::exit(-1);
|
||||
}, Qt::QueuedConnection);
|
||||
engine.load(url);
|
||||
|
||||
return app.exec();
|
||||
}
|
Reference in New Issue
Block a user