From 394249616cbb4c0861a032d33f846f85e2801677 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Thu, 27 Sep 2012 15:24:34 +0100 Subject: OpenGL: Don't request a context version higher than is supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function wglCreateContextAttribsARB will fail if we request a context version higher than is supported. We therefore upper-bound the requested version by the version of the static context. This results in context creation succeeding and having the closest possible match to the requested format. The xcb qpa plugin is modified to operate similarly to the windows plugin in that it now creates a "static" context which is used to limit the versions of contexts requested by the user. Change-Id: I277ad7cc82edfdf7b9d8502ad921c8175feb1a4a Reviewed-by: Samuel Rødal --- src/opengl/qgl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/opengl/qgl.cpp') diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 147a823431..9b456f6a64 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3002,6 +3002,14 @@ bool QGLContext::areSharing(const QGLContext *context1, const QGLContext *contex specified in the constructor; otherwise returns false (i.e. the context is invalid). + If the OpenGL implementation on your system does not support the requested + version of OpenGL context, then QGLContext will try to create the closest + matching version. The actual created context properties can be queried + using the QGLFormat returned by the format() function. For example, if + you request a context that supports OpenGL 4.3 Core profile but the driver + and/or hardware only supports version 3.2 Core profile contexts then you will + get a 3.2 Core profile context. + After successful creation, format() returns the set of features of the created GL rendering context. -- cgit v1.2.3