This is necessary so that QGLFormat::openGLVersionFlags() returns the
complete set of versions. Without this patch the temporary context
ends up obtaining an OpenGL 2.x context as the QPA plugins now prefer
to use the ARB {wgl,glx}CreateContextAttribsARB function which creates
contexts of the specified version (2.0 for a default QSurfaceFormat).
Change-Id: I2c3e02c9d7b77d4ee0484f9e8786f41675f8a439
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
d->window->create();
d->context = new QOpenGLContext;
+#if !defined(QT_OPENGL_ES)
+ // On desktop, request latest released version
+ QSurfaceFormat format;
+ format.setMajorVersion(4);
+ format.setMinorVersion(3);
+ d->context->setFormat(format);
+#endif
d->context->create();
d->context->makeCurrent(d->window);
}