aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/sgengine
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2014-12-18 09:21:28 +0100
committerAndy Shaw <andy.shaw@digia.com>2014-12-18 22:57:49 +0100
commita380342ba4102e9c07fe2676d0a637603c2c4d24 (patch)
treece1fea3ddd22545aebb94c00749152b7bb1d1683 /examples/quick/scenegraph/sgengine
parentbbbbfc06a053896a335161c9aa41bee93048daba (diff)
Fix compile issue with -opengl dynamic on Windows
Change-Id: I2b17482c0e8d04718e91b9772784afce4ebdc101 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'examples/quick/scenegraph/sgengine')
-rw-r--r--examples/quick/scenegraph/sgengine/window.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/quick/scenegraph/sgengine/window.cpp b/examples/quick/scenegraph/sgengine/window.cpp
index 9af4029165..bc371a38f6 100644
--- a/examples/quick/scenegraph/sgengine/window.cpp
+++ b/examples/quick/scenegraph/sgengine/window.cpp
@@ -47,6 +47,7 @@
#include <QSGTransformNode>
#include <QScreen>
#include <QVariantAnimation>
+#include <QOpenGLFunctions>
class Item {
public:
@@ -213,13 +214,14 @@ void Window::initialize()
m_sgRenderer->setClearColor(QColor(32, 32, 32));
// With QSGEngine::createTextureFromId
+ QOpenGLFunctions glFuncs(m_context.data());
GLuint glTexture;
- glGenTextures(1, &glTexture);
- glBindTexture(GL_TEXTURE_2D, glTexture);
+ glFuncs.glGenTextures(1, &glTexture);
+ glFuncs.glBindTexture(GL_TEXTURE_2D, glTexture);
QImage smile = QImage(":/scenegraph/sgengine/face-smile.png").scaled(48, 48, Qt::KeepAspectRatio, Qt::SmoothTransformation);
smile = smile.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
Q_ASSERT(!smile.isNull());
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, smile.width(), smile.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, smile.constBits());
+ glFuncs.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, smile.width(), smile.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, smile.constBits());
m_smileTexture.reset(m_sgEngine->createTextureFromId(glTexture, smile.size(), QFlag(QSGEngine::TextureOwnsGLTexture | QSGEngine::TextureHasAlphaChannel)));
// With QSGEngine::createTextureFromImage