From ea19e075c7eb34a6a7979fa3cfb2dcc838d33c11 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 8 Sep 2009 11:43:41 +1000 Subject: Texture format must be GL_RGB when pixel type is GL_UNSIGNED_SHORT_5_6_5 QImage::Format_RGB16 textures were broken on some OpenGL/ES 1.1 systems because the "format" was set to GL_RGBA and the "texture_format" was set to GL_RGB, with a pixel type of GL_UNSIGNED_SHORT_5_6_5. OpenGL/ES 1.1, ES 2.0, and desktop GL all require the two format parameters to glTexImage2D() to be GL_RGB if the pixel type is GL_UNSIGNED_SHORT_5_6_5. Reviewed-by: Sarah Smith --- src/opengl/qgl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 49dc8a2..087902b 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2052,6 +2052,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G case QImage::Format_RGB16: pixel_type = GL_UNSIGNED_SHORT_5_6_5; texture_format = GL_RGB; + format = GL_RGB; break; case QImage::Format_RGB32: if (format == GL_RGBA) -- cgit v0.12