rgb transparacy (sdl)
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.
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));
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 .
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement