handle BGRA8; nVidia cards prefer this format

This commit is contained in:
Glenn Maynard
2007-03-22 05:30:19 +00:00
parent 0cb0394ad1
commit bf16705d1e
4 changed files with 17 additions and 0 deletions
+1
View File
@@ -58,6 +58,7 @@ Preference<float> g_fFrameLimitPercent( "FrameLimitPercent", 0.0f );
static const char *PixelFormatNames[] = { static const char *PixelFormatNames[] = {
"RGBA8", "RGBA8",
"BGRA8",
"RGBA4", "RGBA4",
"RGB5A1", "RGB5A1",
"RGB5", "RGB5",
+1
View File
@@ -54,6 +54,7 @@ protected:
enum PixelFormat enum PixelFormat
{ {
PixelFormat_RGBA8, PixelFormat_RGBA8,
PixelFormat_BGRA8,
PixelFormat_RGBA4, PixelFormat_RGBA4,
PixelFormat_RGB5A1, PixelFormat_RGB5A1,
PixelFormat_RGB5, PixelFormat_RGB5,
+3
View File
@@ -130,6 +130,8 @@ static const RageDisplay::PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PixelFormat] = {
0x0000FF00, 0x0000FF00,
0x000000FF, 0x000000FF,
0xFF000000 } 0xFF000000 }
}, {
0, { 0,0,0,0 }
}, { }, {
/* A4R4G4B4 */ /* A4R4G4B4 */
16, 16,
@@ -177,6 +179,7 @@ static const RageDisplay::PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PixelFormat] = {
static D3DFORMAT D3DFORMATS[NUM_PixelFormat] = static D3DFORMAT D3DFORMATS[NUM_PixelFormat] =
{ {
D3DFMT_A8R8G8B8, D3DFMT_A8R8G8B8,
D3DFMT_UNKNOWN,
D3DFMT_A4R4G4B4, D3DFMT_A4R4G4B4,
D3DFMT_A1R5G5B5, D3DFMT_A1R5G5B5,
D3DFMT_X1R5G5B5, D3DFMT_X1R5G5B5,
+12
View File
@@ -73,6 +73,13 @@ static RageDisplay::PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PixelFormat] = {
0x00FF0000, 0x00FF0000,
0x0000FF00, 0x0000FF00,
0x000000FF } 0x000000FF }
}, {
/* B8G8R8A8 */
32,
{ 0x0000FF00,
0x00FF0000,
0xFF000000,
0x000000FF }
}, { }, {
/* R4G4B4A4 */ /* R4G4B4A4 */
16, 16,
@@ -149,6 +156,11 @@ struct GLPixFmtInfo_t {
GL_RGBA8, GL_RGBA8,
GL_RGBA, GL_RGBA,
GL_UNSIGNED_BYTE, GL_UNSIGNED_BYTE,
}, {
/* R8G8B8A8 */
GL_RGBA8,
GL_BGRA,
GL_UNSIGNED_BYTE,
}, { }, {
/* B4G4R4A4 */ /* B4G4R4A4 */
GL_RGBA4, GL_RGBA4,