comparison src/video/SDL_renderer_gles.c @ 4963:604077962776

Fixed screen texture format on Android I think this also fixes some of the red/blue channel swap bugs reported on iPhone.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 05 Jan 2011 00:09:19 -0800
parents aa8888658021
children 047a580d30f3
comparison
equal deleted inserted replaced
4962:730b234ba9ec 4963:604077962776
116 { 116 {
117 /* OpenGL ES 1.x supported formats list */ 117 /* OpenGL ES 1.x supported formats list */
118 SDL_PIXELFORMAT_ABGR4444, 118 SDL_PIXELFORMAT_ABGR4444,
119 SDL_PIXELFORMAT_ABGR1555, 119 SDL_PIXELFORMAT_ABGR1555,
120 SDL_PIXELFORMAT_BGR565, 120 SDL_PIXELFORMAT_BGR565,
121 SDL_PIXELFORMAT_BGR24, 121 SDL_PIXELFORMAT_RGB24,
122 SDL_PIXELFORMAT_BGR888,
122 SDL_PIXELFORMAT_ABGR8888}, 123 SDL_PIXELFORMAT_ABGR8888},
123 0, 124 0,
124 0} 125 0}
125 }; 126 };
126 127
378 GLenum format, type; 379 GLenum format, type;
379 int texture_w, texture_h; 380 int texture_w, texture_h;
380 GLenum result; 381 GLenum result;
381 382
382 switch (texture->format) { 383 switch (texture->format) {
383 case SDL_PIXELFORMAT_BGR24: 384 case SDL_PIXELFORMAT_RGB24:
384 internalFormat = GL_RGB; 385 internalFormat = GL_RGB;
385 format = GL_RGB; 386 format = GL_RGB;
386 type = GL_UNSIGNED_BYTE; 387 type = GL_UNSIGNED_BYTE;
387 break; 388 break;
389 case SDL_PIXELFORMAT_BGR888:
388 case SDL_PIXELFORMAT_ABGR8888: 390 case SDL_PIXELFORMAT_ABGR8888:
389 internalFormat = GL_RGBA; 391 internalFormat = GL_RGBA;
390 format = GL_RGBA; 392 format = GL_RGBA;
391 type = GL_UNSIGNED_BYTE; 393 type = GL_UNSIGNED_BYTE;
392 break; 394 break;