Remove need for glXGetProcAddressARB

We do already require glXGetProcAddress in line 241.

Fixes: QTBUG-71488
Change-Id: Id0f3bc256a71097241b99d2dcba927c1165e980e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This commit is contained in:
Michal Klocek 2018-11-12 13:17:40 +01:00
parent cbac5a1a6e
commit 4538dd7ec4

View File

@ -38,9 +38,6 @@
****************************************************************************/
#include <QDebug>
#if QT_CONFIG(library)
#include <QLibrary>
#endif
#include "qxcbwindow.h"
#include "qxcbscreen.h"
@ -61,10 +58,6 @@
#include "qxcbglintegration.h"
#if !defined(QT_STATIC) && QT_CONFIG(dlopen)
#include <dlfcn.h>
#endif
QT_BEGIN_NAMESPACE
typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
@ -627,41 +620,7 @@ void QGLXContext::swapBuffers(QPlatformSurface *surface)
QFunctionPointer QGLXContext::getProcAddress(const char *procName)
{
#ifdef QT_STATIC
return glXGetProcAddressARB(reinterpret_cast<const GLubyte *>(procName));
#else
typedef void *(*qt_glXGetProcAddressARB)(const GLubyte *);
static qt_glXGetProcAddressARB glXGetProcAddressARB = 0;
static bool resolved = false;
if (resolved && !glXGetProcAddressARB)
return 0;
if (!glXGetProcAddressARB) {
QList<QByteArray> glxExt = QByteArray(glXGetClientString(m_display, GLX_EXTENSIONS)).split(' ');
if (glxExt.contains("GLX_ARB_get_proc_address")) {
#if QT_CONFIG(dlopen)
void *handle = dlopen(NULL, RTLD_LAZY);
if (handle) {
glXGetProcAddressARB = (qt_glXGetProcAddressARB) dlsym(handle, "glXGetProcAddressARB");
dlclose(handle);
}
if (!glXGetProcAddressARB)
#endif
{
#if QT_CONFIG(library)
QLibrary lib(QLatin1String("GL"));
if (!lib.load())
lib.setFileNameAndVersion(QLatin1String("GL"), 1);
glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
#endif
}
}
resolved = true;
}
if (!glXGetProcAddressARB)
return 0;
return (void (*)())glXGetProcAddressARB(reinterpret_cast<const GLubyte *>(procName));
#endif
return glXGetProcAddress(reinterpret_cast<const GLubyte *>(procName));
}
QSurfaceFormat QGLXContext::format() const