]> git.sesse.net Git - nageru/blob - main.cpp
Hook up white balance into the theme.
[nageru] / main.cpp
1 extern "C" {
2 #include <libavformat/avformat.h>
3 }
4 #include <stdbool.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <epoxy/gl.h>
8
9 #include <QApplication>
10 #include <QCoreApplication>
11 #include <QGL>
12 #include <QSize>
13 #include <QSurfaceFormat>
14
15 #include "context.h"
16 #include "flags.h"
17 #include "mainwindow.h"
18 #include "mixer.h"
19
20 int main(int argc, char *argv[])
21 {
22         setenv("QT_XCB_GL_INTEGRATION", "xcb_egl", 0);
23         setlinebuf(stdout);
24         av_register_all();
25         parse_flags(argc, argv);
26
27         QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
28         QApplication app(argc, argv);
29
30         QSurfaceFormat fmt;
31         fmt.setDepthBufferSize(0);
32         fmt.setStencilBufferSize(0);
33         fmt.setProfile(QSurfaceFormat::CoreProfile);
34         fmt.setMajorVersion(3);
35         fmt.setMinorVersion(1);
36         QSurfaceFormat::setDefaultFormat(fmt);
37
38         QGLFormat::setDefaultFormat(QGLFormat::fromSurfaceFormat(fmt));
39
40         global_share_widget = new QGLWidget();
41
42         MainWindow mainWindow;
43         mainWindow.resize(QSize(1500, 685));
44         mainWindow.show();
45
46         app.installEventFilter(&mainWindow);  // For white balance color picking.
47
48         int rc = app.exec();
49         global_mixer->quit();
50         delete global_mixer;
51         return rc;
52 }