-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.cpp
More file actions
47 lines (41 loc) · 1.5 KB
/
Main.cpp
File metadata and controls
47 lines (41 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <qtwebengineglobal.h>
#include <QLoggingCategory>
#include <QQmlContext>
#include <QDir>
#include "LightModel.h"
#include "TutorialOpenGLView.h"
#include "Lesson1Renderer.h"
#include "Lesson2Renderer.h"
#include "Lesson4Renderer.h"
#include "Lesson5Renderer.h"
#include "Lesson6Renderer.h"
#include "Lesson7Renderer.h"
#include "Lesson8Renderer.h"
#include "Lesson9Renderer.h"
int main(int argc, char *argv[])
{
qputenv("QSG_RENDER_LOOP", "basic");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QLoggingCategory::setFilterRules("qt.scenegraph.general=true");
QtWebEngine::initialize();
qmlRegisterType<TutorialOpenGLView>("OpenGLTutorial", 1, 0, "TutorialOpenGLView");
qmlRegisterType<Light>("LightModel", 1, 0, "Light");
qmlRegisterType<LightModel>("LightModel", 1, 0, "LightModel");
qRegisterMetaType<Lesson1Renderer*>();
qRegisterMetaType<Lesson2Renderer*>();
qRegisterMetaType<Lesson4Renderer*>();
qRegisterMetaType<Lesson5Renderer*>();
qRegisterMetaType<Lesson6Renderer*>();
qRegisterMetaType<Lesson7Renderer*>();
qRegisterMetaType<Lesson8Renderer*>();
qRegisterMetaType<Lesson9Renderer*>();
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("currentPath", QDir::currentPath());
engine.load(QUrl(QStringLiteral("qrc:/Main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}