Fixed R and B channels swapped in pixelformat
This commit is contained in:
@@ -119,6 +119,9 @@ SDL_RenderDriver GL_ES_RenderDriver = {
|
||||
SDL_PIXELFORMAT_ABGR4444,
|
||||
SDL_PIXELFORMAT_ABGR1555,
|
||||
SDL_PIXELFORMAT_BGR565,
|
||||
#ifdef ANDROID
|
||||
SDL_PIXELFORMAT_RGB565,
|
||||
#endif
|
||||
SDL_PIXELFORMAT_BGR24,
|
||||
SDL_PIXELFORMAT_ABGR8888},
|
||||
0,
|
||||
@@ -406,6 +409,13 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
format = GL_RGBA;
|
||||
type = GL_UNSIGNED_SHORT_4_4_4_4;
|
||||
break;
|
||||
#ifdef ANDROID
|
||||
case SDL_PIXELFORMAT_RGB565:
|
||||
internalFormat = GL_RGB;
|
||||
format = GL_RGB;
|
||||
type = GL_UNSIGNED_SHORT_5_6_5;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
SDL_SetError("Unsupported by OpenGL ES texture format");
|
||||
return -1;
|
||||
|
||||
@@ -134,7 +134,7 @@ int ANDROID_VideoInit(_THIS)
|
||||
mode.w = sWindowWidth;
|
||||
mode.h = sWindowHeight;
|
||||
mode.refresh_rate = 0;
|
||||
mode.format = SDL_PIXELFORMAT_BGR565; // SDL_PIXELFORMAT_RGB565;
|
||||
mode.format = SDL_PIXELFORMAT_RGB565;
|
||||
mode.driverdata = NULL;
|
||||
|
||||
SDL_zero(display);
|
||||
@@ -153,7 +153,7 @@ void ANDROID_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
|
||||
mode.w = sWindowWidth;
|
||||
mode.h = sWindowHeight;
|
||||
mode.refresh_rate = 0;
|
||||
mode.format = SDL_PIXELFORMAT_BGR565; // SDL_PIXELFORMAT_RGB565;
|
||||
mode.format = SDL_PIXELFORMAT_RGB565;
|
||||
mode.driverdata = NULL;
|
||||
SDL_AddDisplayMode(display, &mode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user