-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (38 loc) · 1.32 KB
/
Copy pathmain.cpp
File metadata and controls
44 lines (38 loc) · 1.32 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
// Part of the ProceduralTextureMaker project.
// http://github.com/johanokl/ProceduralTextureMaker
// Released under GPLv3.
// Johan Lindqvist (johan.lindqvist@gmail.com)
#include "cli/commandline.h"
#include "gui/applicationtheme.h"
#include "gui/mainwindow.h"
#include "texgenapplication.h"
#include <QApplication>
#include <QSurfaceFormat>
int main(int argc, char** argv) {
const bool commandLineMode = useCommandLineMode(argc, argv);
if (!commandLineMode) {
QSurfaceFormat format;
format.setRenderableType(QSurfaceFormat::OpenGL);
format.setVersion(2, 1);
format.setProfile(QSurfaceFormat::CompatibilityProfile);
format.setDepthBufferSize(24);
QSurfaceFormat::setDefaultFormat(format);
}
QCoreApplication::setOrganizationName("Johan Lindqvist");
QCoreApplication::setOrganizationDomain("github.com/johanokl");
QCoreApplication::setApplicationName("ProceduralTextureMaker");
QCoreApplication::setApplicationVersion("0.1.0");
TexGenApplication app(argc, argv);
if (commandLineMode) {
return runCommandLine(app);
}
ApplicationTheme::apply(app);
MainWindow* window = app.addWindow();
#ifndef Q_OS_MAC
// On macOS the platform sends file-open events to the application.
if (argc > 1) {
window->openFile(QString(argv[1]));
}
#endif
return app.exec();
}