diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2014-11-27 14:42:34 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-02-05 19:20:10 +0000 |
commit | b066467be7f8da03cc50c29d1c42eac0eb2770c4 (patch) | |
tree | 430c9b980cbaa4fbc73dd6b700d9aa75b4a435b2 /src/platformsupport | |
parent | f246e380c373e74ff8a039c7ae057da6c0e6e395 (diff) |
Set some state before rendering the EGL/GLES mouse cursor
Custom OpenGL rendering code often sets these and, unlike the Quick scenegraph,
may not reset it before calling swapBuffers(). Play nice with the most commmon
settings.
Resetting the active texture unit is critical in particular, since frameworks
like Qt3D will change this.
Change-Id: I86acaf7e0b2ce67a23c731fffce4f20375614321
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformcursor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp b/src/platformsupport/eglconvenience/qeglplatformcursor.cpp index b07f8cd470..2af353c6ce 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcursor.cpp @@ -363,6 +363,7 @@ void QEGLPlatformCursor::draw(const QRectF &r) s2, t1 }; + glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, m_cursor.texture); glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -374,6 +375,8 @@ void QEGLPlatformCursor::draw(const QRectF &r) m_program->setUniformValue(m_textureEntry, 0); + glDisable(GL_CULL_FACE); + glFrontFace(GL_CCW); glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_DEPTH_TEST); // disable depth testing to make sure cursor is always on top |