Sign in to follow this  
game mercenary

rgb transparacy (sdl)

Recommended Posts

I want to make a sertian collor be transparesnt in sdl, how do I use SDL_SetColorKey() properly? it crashes the program on me. I am not using sprites, I am trying to get the color transparent.

Share this post


Link to post
Share on other sites
Make sure the image loaded correctly. You could also use:

int r=0, g=0, b=1;
if(img)
SDL_SetColorKey(img, SDL_SRCCOLORKEY, SDL_MapRGB(img->format, r, g, b));
SDL crashes if you try using the pointer that hasn't been loaded into. Check sdlerr.txt .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this