diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-03-04 15:06:36 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-10 15:10:37 +0100 |
commit | 1e8de50674f5b33a50c45224b7e07b3f974f6ab0 (patch) | |
tree | a52d4e421be3c6c2deb4ff07905d5715012b0d9a /src/gui/opengl/qopengltextureblitter.cpp | |
parent | 11eb9d37dc191b6e71c903e4f7f4d2da579e7df5 (diff) |
Avoid using direct OpenGL calls in gui and widgets
Change-Id: I5d88a2e204ca23e178a4e3044b9cb13392c3e763
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/gui/opengl/qopengltextureblitter.cpp')
-rw-r--r-- | src/gui/opengl/qopengltextureblitter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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 <QtGui/QOpenGLShaderProgram> #include <QtGui/QOpenGLVertexArrayObject> #include <QtGui/QOpenGLContext> +#include <QtGui/QOpenGLFunctions> 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() |