This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Pitch, Backbuffer


Pitch, Backbuffer

Postby efortier » May 31, 2002 @ 4:16pm

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.
User avatar
efortier
pm Insider
 
Posts: 373
Joined: May 15, 2002 @ 10:32pm


Postby billcow » May 31, 2002 @ 9:20pm

Most people don't know that "A highly technical term" is actually a highly technical term used to describe something that doesn't mean anything
User avatar
billcow
pm Member
 
Posts: 81
Joined: Jan 6, 2002 @ 12:22am
Location: Dryden, NY


Postby Johan » May 31, 2002 @ 10:20pm

User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby efortier » Jun 4, 2002 @ 7:37pm

User avatar
efortier
pm Insider
 
Posts: 373
Joined: May 15, 2002 @ 10:32pm


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron