summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-20 17:39:48 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-21 21:22:46 +0200
commit43431619d644ebd783d292a12c1904cfd7680824 (patch)
tree7d79c2b79f6ed450613b29de700ee488d8cd99f4 /examples
parent7a1b5b1cfece18d5f4b2d8beb340d3cbe8f54451 (diff)
parentcb6c208c77e2e3c8b6d5957fae73f0326eee4296 (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: src/quick/items/qquickflickable_p_p.h src/quick/items/qquickpathview_p_p.h tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp Change-Id: I77664a095d8a203e07a021c9d5953e02b8b99a1e
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/textureprovider/etcprovider.cpp8
-rw-r--r--examples/quick/textureprovider/etcprovider.h4
2 files changed, 7 insertions, 5 deletions
diff --git a/examples/quick/textureprovider/etcprovider.cpp b/examples/quick/textureprovider/etcprovider.cpp
index c713cf1ffd..de8eb12366 100644
--- a/examples/quick/textureprovider/etcprovider.cpp
+++ b/examples/quick/textureprovider/etcprovider.cpp
@@ -98,7 +98,7 @@ unsigned short getPaddedHeight(ETCHeader *pHeader)
EtcTexture::EtcTexture()
: m_texture_id(0), m_uploaded(false)
{
-
+ initializeOpenGLFunctions();
}
EtcTexture::~EtcTexture()
@@ -109,8 +109,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 75903963e4..44d5d6f53e 100644
--- a/examples/quick/textureprovider/etcprovider.h
+++ b/examples/quick/textureprovider/etcprovider.h
@@ -51,7 +51,7 @@
#ifndef ETCPROVIDER_H
#define ETCPROVIDER_H
-#include <qopengl.h>
+#include <QOpenGLFunctions>
#include <QQuickImageProvider>
#include <QtQuick/QSGTexture>
#include <QUrl>
@@ -71,7 +71,7 @@ private:
QUrl m_baseUrl;
};
-class EtcTexture : public QSGTexture
+class EtcTexture : public QSGTexture, protected QOpenGLFunctions
{
Q_OBJECT
public: