From b066467be7f8da03cc50c29d1c42eac0eb2770c4 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 27 Nov 2014 14:42:34 +0100 Subject: 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 --- src/platformsupport/eglconvenience/qeglplatformcursor.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/platformsupport') 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 -- cgit v1.2.3