Jump to content
  • Advertisement
Sign in to follow this  
ChaosIII

SDL using surface and pixel alpha?

This topic is 2828 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

Hey,
I know there have been tons of threads about SDL alpha, but I can't seem to figure this out ...

I am trying to create a simple particle system with SDL to create smoke and fire effects. Now the problem I ran into is that apparently can't use surface and pixel alpha together. If I optimize my surfaces with SDL_DisplayFormat(), I can use per surface alpha but not per pixel. If I use SDL_DisplayFormatAlpha(), it's the other way around.

So is there a way to load a PNG file with an alpha channel and then fade the entire image? Maybe by manually altering the per pixel alpha values? Or do I have to go with OGL to be able to do this?

Thanks in Advance,
ChaosIII

Share this post


Link to post
Share on other sites
Advertisement
IIRC I considered this particular problem of surface alpha vs. pixel alpha 3-4 years ago and it wasn't possible at that time. I don't know if it's any different in SDL 1.3...

Of course, you could manually manipulate surface pixel buffers but that's kinda wasteful and we have modern GPUs for a reason.

So yes, I think using OGL under SDL is the way to go (it would also help in other cases).

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!