summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-08 01:43:41 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-08 01:43:41 (GMT)
commitea19e075c7eb34a6a7979fa3cfb2dcc838d33c11 (patch)
tree4646ddf73ceb73331a80184c4b91e0d622eefee9
parent7b7e776d9042fa34a17db3189af99efb7494d070 (diff)
downloadQt-ea19e075c7eb34a6a7979fa3cfb2dcc838d33c11.zip
Qt-ea19e075c7eb34a6a7979fa3cfb2dcc838d33c11.tar.gz
Qt-ea19e075c7eb34a6a7979fa3cfb2dcc838d33c11.tar.bz2
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
-rw-r--r--src/opengl/qgl.cpp1
1 files changed, 1 insertions, 0 deletions
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)