GP2X Sdl Transparency


CapnKroaker

Still Fresh
Joined
Feb 8, 2006
Messages
2
Hi all,

Got my GP2X today (bought mostly for writing games on) and have ported over my little SDL based sprite toolkit / game engine. Its all working fine but as it was already cross compiling between Linux, Mac OS and Windows it was just a matter of sorting out a new makefile.

The only problem I have got is one that is hardware specific and thats transparency on my sprites. Previously I'd been using 32bpp surfaces and using the alpha channel but thats out on the GP2X and I'm really not sure how I go about transparency in a 16bpp environment through SDL.

Any tips or simple example code?

Thanks.
 
CapnKroaker posted on Feb 8 2006 at 08:28 PM said:
Hi all,

Got my GP2X today (bought mostly for writing games on) and have ported over my little SDL based sprite toolkit / game engine. Its all working fine but as it was already cross compiling between Linux, Mac OS and Windows it was just a matter of sorting out a new makefile.

The only problem I have got is one that is hardware specific and thats transparency on my sprites. Previously I'd been using 32bpp surfaces and using the alpha channel but thats out on the GP2X and I'm really not sure how I go about transparency in a 16bpp environment through SDL.

Any tips or simple example code?

Thanks.

It should work the same like in the 32bpp mode. Surfaces will be converted to the 16bpp and alpha should be saved too. It will look a bit worse and will be much slower on the gp2x thought. If you are depending on the alpha much then better use a colorkey instead (if possible).
 
Last edited by a moderator:
Thanks for that. My engine was previously running in OpenGL on top of SDL and I'd got that used to thinking in terms of the alpha channel that I'd forgot all about color keying.

Changed and everything now works.

Thanks Radek.
 
Back
Top