Fixed screen texture format on Android
authorSam Lantinga <slouken@libsdl.org>
Wed, 05 Jan 2011 00:09:19 -0800
changeset 4963 604077962776
parent 4962 730b234ba9ec
child 4964 6c645018741e
Fixed screen texture format on Android I think this also fixes some of the red/blue channel swap bugs reported on iPhone.
src/video/SDL_renderer_gles.c
src/video/android/SDL_androidvideo.c
--- a/src/video/SDL_renderer_gles.c	Tue Jan 04 21:05:42 2011 -0800
+++ b/src/video/SDL_renderer_gles.c	Wed Jan 05 00:09:19 2011 -0800
@@ -118,7 +118,8 @@
       SDL_PIXELFORMAT_ABGR4444,
       SDL_PIXELFORMAT_ABGR1555,
       SDL_PIXELFORMAT_BGR565,
-      SDL_PIXELFORMAT_BGR24,
+      SDL_PIXELFORMAT_RGB24,
+      SDL_PIXELFORMAT_BGR888,
       SDL_PIXELFORMAT_ABGR8888},
      0,
      0}
@@ -380,11 +381,12 @@
     GLenum result;
 
     switch (texture->format) {
-    case SDL_PIXELFORMAT_BGR24:
+    case SDL_PIXELFORMAT_RGB24:
         internalFormat = GL_RGB;
         format = GL_RGB;
         type = GL_UNSIGNED_BYTE;
         break;
+    case SDL_PIXELFORMAT_BGR888:
     case SDL_PIXELFORMAT_ABGR8888:
         internalFormat = GL_RGBA;
         format = GL_RGBA;
--- a/src/video/android/SDL_androidvideo.c	Tue Jan 04 21:05:42 2011 -0800
+++ b/src/video/android/SDL_androidvideo.c	Wed Jan 05 00:09:19 2011 -0800
@@ -124,7 +124,7 @@
     SDL_DisplayMode mode;
 
     /* Use a fake 32-bpp desktop mode */
-    mode.format = SDL_PIXELFORMAT_RGB888;
+    mode.format = SDL_PIXELFORMAT_BGR888;
     mode.w = iScreenWidth;
     mode.h = iScreenHeight;
     mode.refresh_rate = 0;