Don't try to load opengl extensions or functions without QLibrary

Change-Id: If77ca6e04c83d94fd3063b68963b1bcd90980d99
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
Ulf Hermann 2015-06-11 17:26:05 +02:00
parent 8b81f89dff
commit 53b83ac413
2 changed files with 9 additions and 3 deletions

View File

@ -78,8 +78,9 @@ public:
private:
bool init();
QFunctionPointer resolve(const char *name);
#ifndef QT_NO_LIBRARY
QLibrary m_gl;
#endif
};
class Q_GUI_EXPORT QOpenGLExtensions : public QOpenGLFunctions

View File

@ -3208,7 +3208,9 @@ Q_GLOBAL_STATIC(QOpenGLES3Helper, qgles3Helper)
bool QOpenGLES3Helper::init()
{
#ifndef Q_OS_IOS
#ifdef QT_NO_LIBRARY
return false;
#elif !defined(Q_OS_IOS)
# ifdef Q_OS_WIN
# ifndef QT_DEBUG
m_gl.setFileName(QStringLiteral("libGLESv2"));
@ -3228,8 +3230,11 @@ QFunctionPointer QOpenGLES3Helper::resolve(const char *name)
{
#ifdef Q_OS_IOS
return QFunctionPointer(dlsym(RTLD_DEFAULT, name));
#else
#elif !defined(QT_NO_LIBRARY)
return m_gl.resolve(name);
#else
Q_UNUSED(name);
return 0;
#endif
}