   SDL_DisplayFormatAlpha not working?
  I am trying to use the SDL_DisplayFormatAlpha function to optimize png images as I load them. But when I analyze the surfaces after I load them, I notice that they always show to have a format with 32bpp no matter what I change my screen surface bpp to. I have played with changing the depth of my png's using Paint.NET but no matter what I change them to they always show 32bpp in my debug sessions.Anyone have any ideas?Thanks,kratz   
  SDL_DisplayFormatAlpha returns a surface that always has an alpha channel enabled on it. I don't know for sure but I would imagine that internally SDL does alpha only on 32bit surfaces with 8 bits per channel. If you are using per pixel alpha with anything other than a 32 bit screen then SDL has to do extra conversions internally to get your image to display on the screen.Moving back to the bigger picture - what are you trying to gain by using png images with an alpha channel? If you are trying to use per pixel alpha on SDL you may want to reconsider unless you plan on using OpenGL or DX to do your rendering as per pixel alpha is kind of expensive in SDL and can quickly slow down your application depending on how much it is used.On the other hand simple color keying usually does the trick and pretty quickly as well. Remember - compressed image files really only save you disk space - not memory since in most cases they are uncompressed to raw rgb(a) data in texture/surface memory anyway.   ;  Thanks for the reply. I'm still kind of new at this so let me see if I am understanding you correclty. When you say "per pixel alpha" you mean an image that only uses transparency on some of its pixels, right. And this is more expensive than say telling SDL to use transparency on all pixels of the surface. Is that correct?I'm using png's simply because I wanted to have transparency without having to set a color key and because all of my images are already in that format. I'll try color keying the png's and see what happens.Thankskratz   ;  SDL supports per pixel alpha and per surface alpha. I have found that per surface alpha was a bit less taxing than per pixel alpha however color keying is as fast as you will get on SDL without 3d acceleration.The main difference between alpha blending and color keying is that alpha blending "blends" the source and destination color (exactly how depends on the surface flags) and color keying ignores the pixel all together. The fastest operation you can do is none at all.That being said your alpha images will come in handy if you use a 3d api such as OpenGL or Direct X as they do not do traditional color keying but use alpha blending instead on the video card instead of the CPU which SDL uses. This is why many of todays 2D games use OpenGL or DX because in comparison the alpha blending, rotation and scaling is done on the GPU instead of the CPU ultimately giving you better FPS and more flexibility.   ;  Thanks for clearing some of that up for me. I found that I can use color keying with my png's and instead of using DisplayFormatAlpha I can use DisplayFormat instead which correctly converts the image bpp. I'm not quite ready to use OpenGl yet but hopefully I'll get there someday :)Thanks againkratz   