add FMT_A1BGR5

This commit is contained in:
Glenn Maynard
2003-06-30 03:13:53 +00:00
parent 0e2fe4a69d
commit 108a3cceee
3 changed files with 33 additions and 13 deletions
+5 -2
View File
@@ -43,9 +43,12 @@ enum PixelFormat {
FMT_RGB5A1, FMT_RGB5A1,
FMT_RGB5, FMT_RGB5,
FMT_RGB8, FMT_RGB8,
/* This may not be as well-supported as RGBA; it's used to speed up DirectShow. */
FMT_BGR8,
FMT_PAL, FMT_PAL,
/* The above formats differ between OpenGL and D3D. These are provided as
* alternatives for OpenGL that match some format in D3D. Don't use them
* directly; they'll be matched automatically by FindPixelFormat. */
FMT_BGR8,
FMT_A1BGR5,
NUM_PIX_FORMATS NUM_PIX_FORMATS
}; };
+8 -4
View File
@@ -166,13 +166,16 @@ static const PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PIX_FORMATS] = {
0x00FF00, 0x00FF00,
0x0000FF, 0x0000FF,
0x000000 } 0x000000 }
}, {
/* BGRA (N/A; OpenGL only) */
0, { 0,0,0,0 }
}, { }, {
/* Paletted */ /* Paletted */
8, 8,
{ 0,0,0,0 } /* N/A */ { 0,0,0,0 } /* N/A */
}, {
/* BGR (N/A; OpenGL only) */
0, { 0,0,0,0 }
}, {
/* ABGR (N/A; OpenGL only) */
0, { 0,0,0,0 }
} }
}; };
@@ -187,8 +190,9 @@ static D3DFORMAT D3DFORMATS[NUM_PIX_FORMATS] =
#else #else
D3DFMT_A8R8G8B8, D3DFMT_A8R8G8B8,
#endif #endif
D3DFMT_P8,
D3DFMT_UNKNOWN, /* no BGR */ D3DFMT_UNKNOWN, /* no BGR */
D3DFMT_P8 D3DFMT_UNKNOWN /* no ABGR */
}; };
const PixelFormatDesc *RageDisplay_D3D::GetPixelFormatDesc(PixelFormat pf) const const PixelFormatDesc *RageDisplay_D3D::GetPixelFormatDesc(PixelFormat pf) const
+20 -7
View File
@@ -134,6 +134,10 @@ static PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PIX_FORMATS] = {
0x00FF00, 0x00FF00,
0x0000FF, 0x0000FF,
0x000000 } 0x000000 }
}, {
/* Paletted */
8,
{ 0,0,0,0 } /* N/A */
}, { }, {
/* B8G8R8A8 */ /* B8G8R8A8 */
24, 24,
@@ -142,9 +146,12 @@ static PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PIX_FORMATS] = {
0xFF0000, 0xFF0000,
0x000000 } 0x000000 }
}, { }, {
/* Paletted */ /* A1B5G5R5 */
8, 16,
{ 0,0,0,0 } /* N/A */ { 0x7C00,
0x03E0,
0x001F,
0x8000 },
} }
}; };
@@ -178,16 +185,21 @@ struct GLPixFmtInfo_t {
GL_RGB8, GL_RGB8,
GL_RGB, GL_RGB,
GL_UNSIGNED_BYTE, GL_UNSIGNED_BYTE,
}, {
/* Paletted */
GL_COLOR_INDEX8_EXT,
GL_COLOR_INDEX,
GL_UNSIGNED_BYTE,
}, { }, {
/* B8G8R8 */ /* B8G8R8 */
GL_RGB8, GL_RGB8,
GL_BGR, GL_BGR,
GL_UNSIGNED_BYTE, GL_UNSIGNED_BYTE,
}, { }, {
/* Paletted */ /* A1R5G5B5 (matches D3DFMT_A1R5G5B5) */
GL_COLOR_INDEX8_EXT, GL_RGB5_A1,
GL_COLOR_INDEX, GL_BGRA,
GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_1_5_5_5_REV,
} }
}; };
@@ -528,6 +540,7 @@ bool RageDisplay_OGL::SupportsTextureFormat( PixelFormat pixfmt )
case FMT_PAL: case FMT_PAL:
return GLExt::glColorTableEXT && GLExt::glGetColorTableParameterivEXT; return GLExt::glColorTableEXT && GLExt::glGetColorTableParameterivEXT;
case FMT_BGR8: case FMT_BGR8:
case FMT_A1BGR5:
return g_bGL_EXT_bgra; return g_bGL_EXT_bgra;
default: default:
return true; // No way to query this in OGL. You pass it a format and hope it doesn't have to convert. return true; // No way to query this in OGL. You pass it a format and hope it doesn't have to convert.