Fix OpenGL context creation in the XCB plugin
authorFredrik Höglund <fredrik@kde.org>
Mon, 4 Feb 2013 14:59:22 +0000 (15:59 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 22 Feb 2013 23:29:13 +0000 (00:29 +0100)
commit4b54c553058f278cedf1d40edacdc488aaa54f81
treee413d47a54c41a5b754e337a1ca71b0e98adc2b6
parent1b08e0307dfebe561fbb0819a2d6b53edd8e8e93
Fix OpenGL context creation in the XCB plugin

Make it possible to create a core context with OpenGL implementations
that don't implement the compatibility profile or the
GL_ARB_compatibility extension.

Qt was effectively clamping the OpenGL version to 3.0 by assuming that
the highest supported backwards compatible version is also the
highest supported core version.

Since there is no way to check if the implementation supports a
context with a given set of attributes without trying to create the
context, we have to try every known OpenGL version until we find one
that's supported.

Note that this commit does not fix similar breakage on other platforms.

Change-Id: I9616762b059db9e6182f853ab7f24ff44dc7d529
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
src/plugins/platforms/xcb/qglxintegration.cpp
src/plugins/platforms/xcb/qglxintegration.h
src/plugins/platforms/xcb/qxcbconnection.cpp
src/plugins/platforms/xcb/qxcbintegration.cpp
src/plugins/platforms/xcb/qxcbintegration.h