Jump to content
  • Advertisement
Sign in to follow this  
game mercenary

rgb transparacy (sdl)

This topic is 4883 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!