PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Where 24bit graphics get converted to 16bit graphics?

Hello, I am new to GapiDraw, because so far I used PocketHAL and created all the libraries by myself.

I know that GapiDraw support more graphics fonts but they are all 24-bit. On the other hand, majority of PocketPCs support 16bit (565) graphics.

Say I create graphics for PocketPC - a sprite map for example. My output from photoshop will be 24bit .png file. Where that file gets transformed to 16bit graphics format? is that 24 bit file stored in PocketPC and get trasnformed to 16bit in realtime? I have developed my own conversin routines and my own 16bit 565 file format, that cooperated with my PocketHAL libraries. I know, it took a lot of computer time, to do the conversion.

My question is, if the data get converted from 24bit to 16bit during game play, does it not put too much system requirements, and does it not slow the game down? Should not I develop some kind of 16bit file format for GAPIDraw? Indeed, is that doable for GAPIDraw?

Thank you very much,
Rene.
Bunkai wrote:My output from photoshop will be 24bit .png file. Where that file gets transformed to 16bit graphics format?


Hi Rene,

All surfaces in GapiDraw ("CGapiSurface") are stored in a format that is 100% compatible with the display, such as the 565 pixel format. Thus the conversion from 24-bit to 16-bit is done during image import from a picture to a surface. If you use BMP or PNG, this conversion will be done on a row-by-row basis, with minimum of memory overhead.

Also, the contents of the surface might be rotated if the display is rotated, to improve blitting performance.

To get access to the surface buffer (in display compatible format) you can use CGapiSurface::GetBuffer. Check the Plasma demo for details on this. :-)

Cheers
Johan
Hello Johan,

Thank you very much for detailed information. It helped me a lot.. Probably the conversion is done when the game is launched, during game initialization process.... Hopefully the player does not have to wait a long, if there is a lot of graphics in the game.

With regards,
Rene.