rgb transparacy (sdl)

Started by
4 comments, last by game mercenary 19 years, 2 months ago
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.
Advertisement
Here you go...
Rob Loach [Website] [Projects] [Contact]
it gets an error and crashed the program
int r=0,g=0,b=1;
SDL_SetColorKey(img, SDL_SRCCOLORKEY,
SDL_MapRGB(img->format, r, g, b));
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 .
Rob Loach [Website] [Projects] [Contact]
the program works perfect without the setcollorkey func. there is nothing in the stdout or stderr file.
oops, did that before I declared the images, it works now, thanks

This topic is closed to new replies.

Advertisement