From 1e8de50674f5b33a50c45224b7e07b3f974f6ab0 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 4 Mar 2014 15:06:36 +0100 Subject: Avoid using direct OpenGL calls in gui and widgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5d88a2e204ca23e178a4e3044b9cb13392c3e763 Reviewed-by: Jørgen Lind --- src/gui/opengl/qopengltextureblitter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/gui/opengl/qopengltextureblitter.cpp') diff --git a/src/gui/opengl/qopengltextureblitter.cpp b/src/gui/opengl/qopengltextureblitter.cpp index b776444347..d52517add2 100644 --- a/src/gui/opengl/qopengltextureblitter.cpp +++ b/src/gui/opengl/qopengltextureblitter.cpp @@ -45,6 +45,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -120,11 +121,11 @@ class TextureBinder public: TextureBinder(GLuint textureId) { - glBindTexture(GL_TEXTURE_2D, textureId); + QOpenGLContext::currentContext()->functions()->glBindTexture(GL_TEXTURE_2D, textureId); } ~TextureBinder() { - glBindTexture(GL_TEXTURE_2D, 0); + QOpenGLContext::currentContext()->functions()->glBindTexture(GL_TEXTURE_2D, 0); } }; @@ -196,7 +197,7 @@ void QOpenGLTextureBlitterPrivate::blit(GLuint texture, program->setUniformValue(textureTransformUniformPos, textureTransform); textureMatrixUniformState = User; - glDrawArrays(GL_TRIANGLES, 0, 6); + QOpenGLContext::currentContext()->functions()->glDrawArrays(GL_TRIANGLES, 0, 6); } void QOpenGLTextureBlitterPrivate::blit(GLuint texture, @@ -219,7 +220,7 @@ void QOpenGLTextureBlitterPrivate::blit(GLuint texture, textureMatrixUniformState = Identity; } - glDrawArrays(GL_TRIANGLES, 0, 6); + QOpenGLContext::currentContext()->functions()->glDrawArrays(GL_TRIANGLES, 0, 6); } QOpenGLTextureBlitter::QOpenGLTextureBlitter() -- cgit v1.2.3