]> git.sesse.net Git - nageru/commitdiff
Create QApplication after setting the OpenGL default format. Fixes a warning in newer Qt.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 19 Feb 2018 08:39:35 +0000 (09:39 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 19 Feb 2018 08:39:35 +0000 (09:39 +0100)
main.cpp

index d0427d1489a353ffb720462051d537d08f8822a4..afac03ed4d3ea81e4c2c813d3bb0b119a097ef07 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -35,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);
@@ -52,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");