Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Transparent Bitmaps (SDL)

This topic is 5646 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

To make the bitmap ''swat1up'' have transparency on its white pixels, I put: int SDL_SetColorKey(SDL_Surface *swat1up, SDL_SRCCOLORKEY, 0, 0, 0); I get error C2059: syntax error : ''constant''

Share this post


Link to post
Share on other sites
Advertisement
error C2501: ''SDL_SetColorKey'' : missing storage-class or type specifiers

error C2373: ''SDL_SetColorKey'' : redefinition; different type modifiers

c:\unzipped\sdl-devel-1.2.3-vc6[1]\sdl-1.2.3\include\sdl_video.h(567) : see declaration of ''SDL_SetColorKey''

error C2078: too many initializers

Share this post


Link to post
Share on other sites
quote:
Original post by BioSquirrel
int SDL_SetColorKey(SDL_Surface *swat1up, SDL_SRCCOLORKEY, 0, 0, 0);


You're declaring a function prototype here: almost certainly not what you want. The format should be:

SDL_SetColorKey(swat1up, SDL_SRCCOLORKEY, 0, 0, 0);

It's just a function call, after all. But also see what Ronin posted above. Or use my little function here:

inline int SDL_SetNativeColorKey(SDL_Surface* const in, int flags, Uint8 r, Uint8 g, Uint8 b)
{
return SDL_SetColorKey(in, flags|SDL_SRCCOLORKEY, SDL_MapRGB(in->format, r, g, b));
}


[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

[edited by - Kylotan on December 4, 2002 8:31:35 PM]

Share this post


Link to post
Share on other sites

  • 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!