# HG changeset patch # User reimar # Date 1345315453 0 # Node ID 4f99cedb514143b9f06ca1f9333026ca6591025c # Parent 4ba5b32b61acb69e66cd0c1826027d9ef371d97d Hack to make BGRA work both in GL and GLES. diff -r 4ba5b32b61ac -r 4f99cedb5141 libvo/gl_common.c --- a/libvo/gl_common.c Sat Aug 18 18:19:57 2012 +0000 +++ b/libvo/gl_common.c Sat Aug 18 18:44:13 2012 +0000 @@ -352,7 +352,7 @@ *gl_type = GL_UNSIGNED_BYTE; break; case IMGFMT_BGRA: - *gl_texfmt = GL_BGRA; + *gl_texfmt = GL_RGBA; *gl_format = GL_BGRA; *gl_type = GL_UNSIGNED_BYTE; break; @@ -567,6 +567,8 @@ if (h == 0) h = 1; stride = w * glFmt2bpp(format, type); if (!stride) return; + // For BGRA internal format must be BGRA for GLES and RGBA for GL... + if (format == GL_BGRA && !mpglBegin) fmt = GL_BGRA; init = malloc(stride * h); memset(init, val, stride * h); glAdjustAlignment(stride);