-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
36 lines (25 loc) · 845 Bytes
/
main.cpp
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
#include <QApplication>
#include <QGLFormat>
#include "mainwindow.h"
#include "view.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGLFormat glFormat;
glFormat.setVersion(3, 3);
glFormat.setProfile(QGLFormat::CoreProfile);
//glFormat.setProfile(QGLFormat::CompatibilityProfile);
glFormat.setSampleBuffers( true );
glFormat.setSamples(8);
QGLFormat::setDefaultFormat(glFormat);
MainWindow w;
bool startFullscreen = false;
w.show();
if (startFullscreen) {
// We cannot use w.showFullscreen() here because on Linux that creates the
// window behind all other windows, so we have to set it to fullscreen after
// it has been shown.
w.setWindowState(w.windowState() | Qt::WindowFullScreen);
}
return a.exec();
}