Hi,
After playing a bit with subclassing a CGapiSurface, and I have a few questions.
First, I have an iPaq 3850. The color format of the backbuffer is 565. However, when I check the type of bitmaps loaded with a CGapiSurface, the format is 555. Why? Shouldn't the loaded bitmaps be in the same format as the display?
Second, I'm using these functions to convert to and from 555 format. However, they don't work as they should. Can someone spot any errors?
char C555ToRed(WORD Color)
{
return (Color & 0x7c00)>>10;
}
char C555ToGreen(WORD Color)
{
return (Color & 0x03e0)>>5;
}
char C555ToBlue(WORD Color)
{
return (Color & 0x001f);
}
WORD RGBTo555(char R, char G, char B)
{
return (WORD)( (R<<10) | (G<<5) | B );
}
Third. When locking a surface, the pitch returned is 480 on my device. How should I use this? I tried adding it to get to the next line, but it doesn't seem to work... Natively, my iPaq pitched are -320,1.
Thanks.