]> git.sesse.net Git - nageru/blobdiff - main.cpp
Create QApplication after setting the OpenGL default format. Fixes a warning in newer Qt.
[nageru] / main.cpp
index 9177025faca57ff6c8cc3ce306b8abb9a6976e39..afac03ed4d3ea81e4c2c813d3bb0b119a097ef07 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -13,6 +13,7 @@ extern "C" {
 #include <QSurfaceFormat>
 #include <string>
 
+#include "basic_stats.h"
 #include "context.h"
 #include "flags.h"
 #include "image_input.h"
@@ -21,7 +22,7 @@ extern "C" {
 
 int main(int argc, char *argv[])
 {
-       parse_flags(argc, argv);
+       parse_flags(PROGRAM_NAGERU, argc, argv);
 
        if (global_flags.va_display.empty() ||
            global_flags.va_display[0] != '/') {
@@ -34,7 +35,6 @@ int main(int argc, char *argv[])
        av_register_all();
 
        QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
-       QApplication app(argc, argv);
 
        QSurfaceFormat fmt;
        fmt.setDepthBufferSize(0);
@@ -51,6 +51,7 @@ int main(int argc, char *argv[])
 
        QGLFormat::setDefaultFormat(QGLFormat::fromSurfaceFormat(fmt));
 
+       QApplication app(argc, argv);
        global_share_widget = new QGLWidget();
        if (!global_share_widget->isValid()) {
                fprintf(stderr, "Failed to initialize OpenGL. Nageru needs at least OpenGL 3.1 to function properly.\n");
@@ -77,8 +78,6 @@ int main(int argc, char *argv[])
                uses_mlock = true;
        }
 
-       pthread_setname_np(pthread_self(), "Nageru_UI");
-
        int rc = app.exec();
        global_mixer->quit();
        mainWindow.mixer_shutting_down();