]> git.sesse.net Git - nageru/blob - main.cpp
Make NUM_CARDS into a command-line flag.
[nageru] / main.cpp
1 #include <stdlib.h>
2 #include <epoxy/gl.h>
3
4 #include <QApplication>
5 #include <QCoreApplication>
6 #include <QGL>
7 #include <QSize>
8 #include <QSurfaceFormat>
9
10 #include "context.h"
11 #include "flags.h"
12 #include "mainwindow.h"
13 #include "mixer.h"
14
15 int main(int argc, char *argv[])
16 {
17         setenv("QT_XCB_GL_INTEGRATION", "xcb_egl", 0);
18         setlinebuf(stdout);
19         av_register_all();
20         parse_flags(argc, argv);
21
22         QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
23         QApplication app(argc, argv);
24
25         QSurfaceFormat fmt;
26         fmt.setDepthBufferSize(0);
27         fmt.setStencilBufferSize(0);
28         fmt.setProfile(QSurfaceFormat::CoreProfile);
29         fmt.setMajorVersion(3);
30         fmt.setMinorVersion(1);
31         QSurfaceFormat::setDefaultFormat(fmt);
32
33         QGLFormat::setDefaultFormat(QGLFormat::fromSurfaceFormat(fmt));
34
35         global_share_widget = new QGLWidget();
36
37         MainWindow mainWindow;
38         mainWindow.resize(QSize(1500, 606));
39         mainWindow.show();
40
41         int rc = app.exec();
42         global_mixer->quit();
43         delete global_mixer;
44         return rc;
45 }