# HG changeset patch # User Sam Lantinga # Date 1259214957 0 # Node ID 61d95a87c3277ed3a1f345ff924b225cf182ebca # Parent 40b1f7cb2062b1c34205fd630275d204ba27fb90 Adam Strzelecki to SDL Currently SDL uses GL_RGB for internalFormat when GL_YCBCR_MESA is passed as format for glTextImage2D when using Linux Mesa's OpenGL. However this is wrong and makes glTextImage2D fail with invalid argument error. GL_YCBCR_MESA should be also internalFormat (not GL_RGB) there and this is what can be found googling various source codes using GL_YCBCR_MESA. diff -r 40b1f7cb2062 -r 61d95a87c327 src/video/SDL_renderer_gl.c --- a/src/video/SDL_renderer_gl.c Wed Nov 25 07:42:23 2009 +0000 +++ b/src/video/SDL_renderer_gl.c Thu Nov 26 05:55:57 2009 +0000 @@ -707,7 +707,7 @@ *type = GL_UNSIGNED_SHORT_8_8_REV_APPLE; #endif } else if (renderdata->GL_MESA_ycbcr_texture_supported) { - *internalFormat = GL_RGB; + *internalFormat = GL_YCBCR_MESA; *format = GL_YCBCR_MESA; #if SDL_BYTEORDER == SDL_LIL_ENDIAN *type = GL_UNSIGNED_SHORT_8_8_MESA; @@ -732,7 +732,7 @@ *type = GL_UNSIGNED_SHORT_8_8_APPLE; #endif } else if (renderdata->GL_MESA_ycbcr_texture_supported) { - *internalFormat = GL_RGB; + *internalFormat = GL_YCBCR_MESA; *format = GL_YCBCR_MESA; #if SDL_BYTEORDER == SDL_LIL_ENDIAN *type = GL_UNSIGNED_SHORT_8_8_REV_MESA;