techpage
asked on
problem with RGB color mode
Hi guys!! i'm having a problem with RGB color mode. in my computer (5x6x5) the game works pretty well, but on other computers (my friends') the color mode is said to be "not supported", i'm wondering why is that? here's the code i've been using in my program:
// get pixel format
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_PIXELFORMAT;
if (FAILED(lpddsprimary->GetS urfaceDesc (&ddsd)))
{WriteError("DirectDraw: Pixel Format not available"); return(0);}
// get color type (5x5x5 or 5x6x5), we need only green value
int g = ddsd.ddpfPixelFormat.dwGBi tMask>>5; // throw 5 bits used for red
if (g == 0x1F) color_type = _5x5x5_; // 0x1F = 31 (5 bit)
else if (g == 0x3F) color_type = _5x6x5_; // 0x3F = 63 (6 bit)
else
{
char buff[60];
sprintf(buff,"DirectDraw: Color Mode not supported\n"
"(Green = %d)", g);
WriteError(buff); // don't know what is the color mode
return(0);
}
i suppose there would be no problems detecting both 5x6x5 and 5x5x5, so it shouldn't give me the message "DirectDraw: Color Mode not supported" right? so what is wrong with it? is there any other color mode i've overlooked anyhow?
thanks in advance!!!
// get pixel format
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_PIXELFORMAT;
if (FAILED(lpddsprimary->GetS
{WriteError("DirectDraw: Pixel Format not available"); return(0);}
// get color type (5x5x5 or 5x6x5), we need only green value
int g = ddsd.ddpfPixelFormat.dwGBi
if (g == 0x1F) color_type = _5x5x5_; // 0x1F = 31 (5 bit)
else if (g == 0x3F) color_type = _5x6x5_; // 0x3F = 63 (6 bit)
else
{
char buff[60];
sprintf(buff,"DirectDraw: Color Mode not supported\n"
"(Green = %d)", g);
WriteError(buff); // don't know what is the color mode
return(0);
}
i suppose there would be no problems detecting both 5x6x5 and 5x5x5, so it shouldn't give me the message "DirectDraw: Color Mode not supported" right? so what is wrong with it? is there any other color mode i've overlooked anyhow?
thanks in advance!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER