Advertisement

[SDL] Using the alpha channel in PNG files

Started by January 12, 2005 11:49 PM
7 comments, last by ImperfectFreak 20 years, 1 month ago
Im using the SDL_Image library to load all my images into my game. what im trying to do is get an image to show up in my game using the exact transparency settings i have saved in the PGN file using photoshop. Right now its not working and Im stumped as to where to start. Anyone have any helpful hints or tutorials i can reference to easily load/render the translucency in the game?
I havent used SDL for a while now but I remember using SDL_image to load a png (using rwops) and I never had to use SDL_SetAlpha() function. The alpha channel just seemed to work.
Advertisement
Thanks guys, will this method of translucency slow down my game?
No dude, its just loading in an image file that has the A value for each pixel set at a different value, ie. 255 for opaque and 0 for transparent. . .
The above poster is right.
---http://www.michaelbolton.comI constantly dream about Michael Bolton.
Although, heavy use of such images when blitting will have an effect on speed. Alpha blending is not a fast operation in SDL.
Advertisement
Use SDL_RLEACCEL, and you should be fine. . .

This topic is closed to new replies.

Advertisement