[SDL] Re: Alpha blending

J. Reeves Hall reeves at earthling.net
Sun Apr 2 13:14:09 PDT 2000


Sam Lantinga wrote:

> > Is there a way to do per-pixel (as opposed to entire surface) alpha
> > blending with SDL? I'd like to use the alpha channel stored by an image
> > editor.
>
> Yes, but there have been some bugs reported in that the conversion loses
> alpha information.  Take a look at the testalpha test program to see how

> it can be done.

I looked at the example, and that's exactly what I want to do, except that I
want to load alpha information from an image file rather than specify it
manually (I'm loading PNG files saved by The GIMP, via the SDL_image
package). This does not seem to happen automatically though; I get an opaque
image when I blit it.

I think I can make do with per-surface alpha for now (it does look good),
but per-pixel would allow a lot of neat effects.

Thanks!
-Reeves

--
J. Reeves Hall, Georgia Tech CS Major
Linux #5 SMP Mon Mar 20 21:56:31 EST 2000
4:08pm  up 8 days,  1:54,  7 users,  load average: 0.08, 0.05, 0.01






More information about the SDL mailing list