diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-04-08 15:05:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-23 12:23:09 +0200 |
commit | e950557e1133e8aac65a453597ab35400a5b9a10 (patch) | |
tree | 835e04f12a584274cec65efaa6071001247417ee /src/quick/items/qquickshadereffectnode.cpp | |
parent | 8a28462c13907800caf44c16580e0b2a2ee99f69 (diff) |
Avoid direct GL calls in Quick
Change-Id: I9b8673fb3292c9d5ad2f9e8e63f56dc661699be6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/quick/items/qquickshadereffectnode.cpp')
-rw-r--r-- | src/quick/items/qquickshadereffectnode.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/items/qquickshadereffectnode.cpp b/src/quick/items/qquickshadereffectnode.cpp index a615cb6f91..f1422e4502 100644 --- a/src/quick/items/qquickshadereffectnode.cpp +++ b/src/quick/items/qquickshadereffectnode.cpp @@ -88,7 +88,7 @@ QQuickCustomMaterialShader::QQuickCustomMaterialShader(const QQuickShaderEffectM void QQuickCustomMaterialShader::deactivate() { QSGMaterialShader::deactivate(); - glDisable(GL_CULL_FACE); + QOpenGLContext::currentContext()->functions()->glDisable(GL_CULL_FACE); } void QQuickCustomMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) @@ -146,7 +146,7 @@ void QQuickCustomMaterialShader::updateState(const RenderState &state, QSGMateri continue; } } - glBindTexture(GL_TEXTURE_2D, 0); + functions->glBindTexture(GL_TEXTURE_2D, 0); } else if (d.specialType == UniformData::Opacity) { program()->setUniformValue(loc, state.opacity()); } else if (d.specialType == UniformData::Matrix) { @@ -217,15 +217,15 @@ void QQuickCustomMaterialShader::updateState(const RenderState &state, QSGMateri if (oldEffect == 0 || material->cullMode != oldMaterial->cullMode) { switch (material->cullMode) { case QQuickShaderEffectMaterial::FrontFaceCulling: - glEnable(GL_CULL_FACE); - glCullFace(GL_FRONT); + functions->glEnable(GL_CULL_FACE); + functions->glCullFace(GL_FRONT); break; case QQuickShaderEffectMaterial::BackFaceCulling: - glEnable(GL_CULL_FACE); - glCullFace(GL_BACK); + functions->glEnable(GL_CULL_FACE); + functions->glCullFace(GL_BACK); break; default: - glDisable(GL_CULL_FACE); + functions->glDisable(GL_CULL_FACE); break; } } @@ -256,7 +256,7 @@ void QQuickCustomMaterialShader::compile() char const *const *attr = attributeNames(); #ifndef QT_NO_DEBUG int maxVertexAttribs = 0; - glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); + QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); int attrCount = 0; while (attrCount < maxVertexAttribs && attr[attrCount]) ++attrCount; |