summaryrefslogtreecommitdiffstats
path: root/src/adaptationlayers/threadedtexturemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/adaptationlayers/threadedtexturemanager.cpp')
-rw-r--r--src/adaptationlayers/threadedtexturemanager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/adaptationlayers/threadedtexturemanager.cpp b/src/adaptationlayers/threadedtexturemanager.cpp
index 46f06a0..b9d128f 100644
--- a/src/adaptationlayers/threadedtexturemanager.cpp
+++ b/src/adaptationlayers/threadedtexturemanager.cpp
@@ -70,6 +70,7 @@ public:
QSGTTMUploadThread *thread;
QGLContext *context;
QGLWidget *widget;
+ QGLFunctions functions;
};
QSGThreadedTextureManager::QSGThreadedTextureManager()
@@ -134,6 +135,7 @@ void QSGThreadedTextureManager::initializeThreadContext()
d->context = const_cast<QGLContext *>(d->widget->context());
if (!d->context)
qFatal("QSGThreadedTextureManager: failed to create thread context...");
+ d->functions.initializeGLFunctions(d->context);
d->widget->doneCurrent();
@@ -174,7 +176,7 @@ void QSGThreadedTextureManager::uploadInThread(TextureReference *texture, const
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_BGRA, GL_UNSIGNED_BYTE, image.constBits());
if (hints & TextureManager::GenerateMipmapUploadHint)
- glGenerateMipmap(GL_TEXTURE_2D);
+ d->functions.glGenerateMipmap(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 0);