From 7aaf293b3573e6c6f2dd22ed91095b61fe342e58 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Wed, 19 Sep 2012 12:07:46 +0100 Subject: OpenGL: Request latest GL version when using QGLTemporaryContext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/opengl/qgl_qpa.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/opengl/qgl_qpa.cpp') diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 117401ce4c..8a07b6a5ad 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -308,6 +308,13 @@ QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *) 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); } -- cgit v1.2.3