summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-04-09 14:09:12 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-04-09 14:13:04 (GMT)
commit254f093dff864f574e05540e771e1fa6d6c4f7c5 (patch)
treef9fdeb1f6b28e1b5e58793092f32de33105ef5ae /src/opengl
parent82870f794fb61930d8a944d78c966b847c831d5c (diff)
downloadQt-254f093dff864f574e05540e771e1fa6d6c4f7c5.zip
Qt-254f093dff864f574e05540e771e1fa6d6c4f7c5.tar.gz
Qt-254f093dff864f574e05540e771e1fa6d6c4f7c5.tar.bz2
Add runtime check for GLX >= 1.3 before using glXCreatePixmap
Task-number: QTBUG-9084 Reviewed-By: TrustMe
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl_x11.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index e1a202f..d203646 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1677,6 +1677,14 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmap *pixmap, cons
#if !defined(GLX_VERSION_1_3) || defined(Q_OS_HPUX)
return 0;
#else
+
+ // Check we have GLX 1.3, as it is needed for glXCreatePixmap & glXDestroyPixmap
+ int majorVersion = 0;
+ int minorVersion = 0;
+ glXQueryVersion(X11->display, &majorVersion, &minorVersion);
+ if (majorVersion < 1 || (majorVersion == 1 && minorVersion < 3))
+ return 0;
+
Q_Q(QGLContext);
QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pixmap->data_ptr().data());