Jump to content
  • Advertisement
Sign in to follow this  
appel

SDL and PNG (2D)

This topic is 4879 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I've noticed that in all the SDL tutorials I've read, and books, only BMP and/or GIF images are used. Using those types you can only define one color to be transparent, all the rest are 100% visible. I feel this is limited as you would want to have edges fade out to transparency. What about PNG? PNG images have alpha layer, but does SDL support it? If it doesn't do other libraries support PNG and alpha layers?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by appel
Hello,

I've noticed that in all the SDL tutorials I've read, and books, only BMP and/or GIF images are used. Using those types you can only define one color to be transparent, all the rest are 100% visible.
I feel this is limited as you would want to have edges fade out to transparency.

What about PNG? PNG images have alpha layer, but does SDL support it? If it doesn't do other libraries support PNG and alpha layers?

SDL does support alpha layers, I believe (haven't used them, since I pretty much only use SDL in combination with OpenGL). It can't load PNG files itself, but the SDL_image extension library will load PNGs (including alpha) with no problem.

If you haven't already got SDL_image, you can get it from here.

John B

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!