Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Support for BGR565 pixel format has been added, mainly for OpenGL ES …

…renderer. OpenGL ES renderer now have new texture formats.
  • Loading branch information
llmike committed Jun 3, 2009
1 parent 8ec0e16 commit 60e69c7049f8f481fc2c79149dc0916c41ca7fb1

File 2 of 3 in 60e69c7

@@ -72,6 +72,12 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask,
masks[2] = 0x000003E0;
masks[3] = 0x0000001F;
break;
case SDL_PACKEDLAYOUT_5551:
masks[0] = 0x0000F800;
masks[1] = 0x000007C0;
masks[2] = 0x0000003E;
masks[3] = 0x00000001;
break;
case SDL_PACKEDLAYOUT_565:
masks[0] = 0x00000000;
masks[1] = 0x0000F800;
@@ -90,6 +96,12 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask,
masks[2] = 0x000FFC00;
masks[3] = 0x000003FF;
break;
case SDL_PACKEDLAYOUT_1010102:
masks[0] = 0xFFC00000;
masks[1] = 0x003FF000;
masks[2] = 0x00000FFC;
masks[3] = 0x00000003;
break;
default:
/* Unknown layout */
return SDL_FALSE;
@@ -176,7 +188,12 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
break;
case 16:
switch (Rmask) {
case 0x000F:
return SDL_PIXELFORMAT_ABGR4444;
case 0x001F:
if (Gmask == 0x07E0) {
return SDL_PIXELFORMAT_BGR565;
}
return SDL_PIXELFORMAT_ABGR1555;
case 0x0F00:
return SDL_PIXELFORMAT_ARGB4444;

0 comments on commit 60e69c7

Please sign in to comment.