Testgl.c alpha

I modified testgl slightly to load png files by replacing the SDL_LoadBMP line with IMG_Load function from SDL_Image. However the alpha layer isnt working I get a blue background around my image.

Any ideas,
Thanks,
Image28

I changed the glColor4ub to 0,0,0,255 and now I get a black background where it should be transparent.

Try (0,0,0,128) and (0,0,0,0). Perhaps you will observe something…
There might be other problems, too. Like not enabled Alpha Blending or the
wrong blending function.On Mon, 25 Oct 2010 14:25:54 -0700, “image28” wrote:

I changed the glColor4ub to 0,0,0,255 and now I get a black
background where it should be transparent.


Christoph Nelles

E-Mail : @Christoph_Nelles
Jabber : eazrael at evilazrael.net ICQ : 78819723

PGP-Key : ID 0x424FB55B on subkeys.pgp.net
or http://evilazrael.net/pgp.txt

Tried those two values, the image didnt show at all with those set. Before I changed the SDL_LoadBMP line to IMG_Load function the bmp file that came with the sdl test program worked with alpha. GL_BLEND is enabled … and blend func is set to GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, with blend set to GL_ONE,GL_ONE the background is blended out, but the rest of the image is opaque, looks like 50%