changeset 35010:4f99cedb5141

Hack to make BGRA work both in GL and GLES.
author reimar
date Sat, 18 Aug 2012 18:44:13 +0000
parents 4ba5b32b61ac
children b0ca340156a4
files libvo/gl_common.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);