summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-07-29 12:50:06 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-07-29 13:17:09 (GMT)
commit0ff4c453bf3d549e8344ab18f643f61a8b6174ef (patch)
tree416d90ce2d3e7a07e3b7bca810238f01bf1ceca2 /src
parente71c1a89f4747c8f94e19113d1fcbc3c51450f3e (diff)
downloadQt-0ff4c453bf3d549e8344ab18f643f61a8b6174ef.zip
Qt-0ff4c453bf3d549e8344ab18f643f61a8b6174ef.tar.gz
Qt-0ff4c453bf3d549e8344ab18f643f61a8b6174ef.tar.bz2
Fix build on Solaris x86 with old Mesa glx headers
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qgl_x11.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 34e9d38..642c7c1 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -58,11 +58,16 @@
#include <private/qglpixelbuffer_p.h>
#endif
+// We always define GLX_EXT_texture_from_pixmap ourselves because
+// we can't trust system headers to do it properly
+#define GLX_EXT_texture_from_pixmap 1
+
#define INT8 dummy_INT8
#define INT32 dummy_INT32
#include <GL/glx.h>
#undef INT8
#undef INT32
+
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
@@ -82,7 +87,7 @@ extern const QX11Info *qt_x11Info(const QPaintDevice *pd);
#define GLX_SAMPLES_ARB 100001
#endif
-#ifndef GLX_EXT_texture_from_pixmap
+#ifndef GLX_TEXTURE_2D_BIT_EXT
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
@@ -1537,7 +1542,7 @@ void QGLExtensions::init()
}
// Solaris defines glXBindTexImageEXT as part of the GL library
-#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) && !defined(glXBindTexImageEXT)
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
typedef void (*qt_glXBindTexImageEXT)(Display*, GLXDrawable, int, const int*);
typedef void (*qt_glXReleaseTexImageEXT)(Display*, GLXDrawable, int);
static qt_glXBindTexImageEXT glXBindTexImageEXT = 0;
@@ -1579,7 +1584,7 @@ bool qt_resolveTextureFromPixmap()
return glXBindTexImageEXT && glXReleaseTexImageEXT;
}
-#endif //defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) && !defined(glXBindTexImageEXT)
+#endif //defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, const qint64 key, bool canInvert)
@@ -1591,10 +1596,8 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, con
Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
-#if !defined(glXBindTexImageEXT)
if (!qt_resolveTextureFromPixmap())
return 0;
-#endif
QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pmd);
const QX11Info &x11Info = pixmapData->xinfo;