diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-01-14 13:02:14 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-16 18:01:38 +0100 |
commit | cc5b698a95ba11691c151399ae53fc5b29c57a9f (patch) | |
tree | b00ee693a02b66022573d8beda3dd7e4052a992b /src/plugins | |
parent | ac864956f8ba6f6cb527725a4347babab2a1e498 (diff) |
Check for GLX_ARB_create_context extension before using it.
Mesa has started defining glXCreateContextAttribsARB even when it is not
supported as a feature. To be sure it is safe to use, we need to also check
if it is supported extension.
Change-Id: Ie160dc2b2418a726957b59f47bd290b742562ae3
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/xcb/qglxintegration.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index 10aaa5a3b5..6b7cd6630b 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -284,8 +284,10 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0; glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB"); + QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(DISPLAY_FROM_XCB(m_screen), m_screen->screenNumber())).split(' '); + // Use glXCreateContextAttribsARB if is available - if (glXCreateContextAttribsARB != 0) { + if (glxExt.contains("GLX_ARB_create_context") && glXCreateContextAttribsARB != 0) { // We limit the requested version by the version of the static context as // glXCreateContextAttribsARB fails and returns NULL if the requested context // version is not supported. This means that we will get the closest supported |