From: Steinar H. Gunderson Date: Mon, 19 Feb 2018 08:39:35 +0000 (+0100) Subject: Create QApplication after setting the OpenGL default format. Fixes a warning in newer Qt. X-Git-Tag: 1.7.0~23 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=0c85018bc5c468ad1b3775d69951e43f11baca19 Create QApplication after setting the OpenGL default format. Fixes a warning in newer Qt. --- diff --git a/main.cpp b/main.cpp index d0427d1..afac03e 100644 --- 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");