hellogles3 example: Fix start-up crash when using dynamic GL

Move the instantiation of QGuiApplication to the top since it is
required by QOpenGLContext::openGLModuleType().

Task-number: QTBUG-55671
Change-Id: I506cee193fe2ba48400851588a8ef079848bc2f4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Friedemann Kleint 2018-01-26 09:46:24 +01:00
parent 342bb5b03a
commit b0310ddd16

View File

@ -64,6 +64,8 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QGuiApplication app(argc, argv);
QSurfaceFormat fmt; QSurfaceFormat fmt;
fmt.setDepthBufferSize(24); fmt.setDepthBufferSize(24);
@ -79,8 +81,6 @@ int main(int argc, char *argv[])
QSurfaceFormat::setDefaultFormat(fmt); QSurfaceFormat::setDefaultFormat(fmt);
QGuiApplication app(argc, argv);
GLWindow glWindow; GLWindow glWindow;
glWindow.showMaximized(); glWindow.showMaximized();