diff options
author | Fredrik Höglund <fredrik@kde.org> | 2013-02-04 15:53:10 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-13 18:42:38 +0100 |
commit | fa167d2afad4c2ff8b7e9412091ffc7e1ffb3458 (patch) | |
tree | c7afa19a6abddbf35cdcc1cff7b4b0aa7a22c3a4 /src/plugins/platforms/xcb | |
parent | b5119f9d4ebc5da542cce68244788b6f5c696beb (diff) |
Check for GLX_ARB_create_context_profile before specifying a profile
Change-Id: Idc4982c039f8a6a304d9ce5ce6736d518fb0ef00
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qglxintegration.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index 23bec15b48..b7f0b14c70 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -285,6 +285,7 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB"); QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(DISPLAY_FROM_XCB(m_screen), m_screen->screenNumber())).split(' '); + bool supportsProfiles = glxExt.contains("GLX_ARB_create_context_profile"); // Use glXCreateContextAttribsARB if is available if (glxExt.contains("GLX_ARB_create_context") && glXCreateContextAttribsARB != 0) { @@ -304,7 +305,7 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat << GLX_CONTEXT_MINOR_VERSION_ARB << minorVersion; // If asking for OpenGL 3.2 or newer we should also specify a profile - if (m_format.majorVersion() > 3 || (m_format.majorVersion() == 3 && m_format.minorVersion() > 1)) { + if (supportsProfiles && (m_format.majorVersion() > 3 || (m_format.majorVersion() == 3 && m_format.minorVersion() > 1))) { if (m_format.profile() == QSurfaceFormat::CoreProfile) contextAttributes << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_CORE_PROFILE_BIT_ARB; else |