Page 1 of 1

Pitch, Backbuffer

PostPosted: May 31, 2002 @ 4:16pm
by efortier
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.

PostPosted: May 31, 2002 @ 9:20pm
by billcow

PostPosted: May 31, 2002 @ 10:20pm
by Johan

PostPosted: Jun 4, 2002 @ 7:37pm
by efortier