diff options
author | Kai Koehne <kai.koehne@qt.io> | 2016-06-13 14:52:45 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2016-06-13 14:22:07 +0000 |
commit | 7f8dc9d00c02e0e28cdea92cac8f8e4379bed68b (patch) | |
tree | b8ff5981946f25249add875c0575b6e30e5e15a7 | |
parent | 4f94ddcf295c59dec86c8570c19e3e7427d68b06 (diff) |
Fix build of textureprovider example with -opengl dynamic
Do not link to OpenGL calls directly. Instead, use QOpenGLFunctions.
Task-number: QTBUG-53841
Change-Id: Ic87bb78fede1ee9f75b81247406ad858b2bf7342
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | examples/quick/textureprovider/etcprovider.cpp | 8 | ||||
-rw-r--r-- | examples/quick/textureprovider/etcprovider.h | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/examples/quick/textureprovider/etcprovider.cpp b/examples/quick/textureprovider/etcprovider.cpp index 7eff597a43..b9bef84f70 100644 --- a/examples/quick/textureprovider/etcprovider.cpp +++ b/examples/quick/textureprovider/etcprovider.cpp @@ -81,7 +81,7 @@ unsigned short getPaddedHeight(ETCHeader *pHeader) EtcTexture::EtcTexture() : m_texture_id(0), m_uploaded(false) { - + initializeOpenGLFunctions(); } EtcTexture::~EtcTexture() @@ -92,8 +92,10 @@ EtcTexture::~EtcTexture() int EtcTexture::textureId() const { - if (m_texture_id == 0) - glGenTextures(1, &const_cast<EtcTexture *>(this)->m_texture_id); + if (m_texture_id == 0) { + EtcTexture *texture = const_cast<EtcTexture*>(this); + texture->glGenTextures(1, &texture->m_texture_id); + } return m_texture_id; } diff --git a/examples/quick/textureprovider/etcprovider.h b/examples/quick/textureprovider/etcprovider.h index a9ec5ed606..e9761e3629 100644 --- a/examples/quick/textureprovider/etcprovider.h +++ b/examples/quick/textureprovider/etcprovider.h @@ -34,7 +34,7 @@ #ifndef ETCPROVIDER_H #define ETCPROVIDER_H -#include <qopengl.h> +#include <QOpenGLFunctions> #include <QQuickImageProvider> #include <QtQuick/QSGTexture> #include <QUrl> @@ -54,7 +54,7 @@ private: QUrl m_baseUrl; }; -class EtcTexture : public QSGTexture +class EtcTexture : public QSGTexture, protected QOpenGLFunctions { Q_OBJECT public: |