[SDL] Removing the black background out of a surface?
Leo M. Cabrera
leo28c at gmail.com
Wed Aug 9 20:47:04 PDT 2006
Hello everyone!
Hey, when you create a surface with SDL_CreateRGBSurface(), it gives you
a black background... If I blit my tank on top of that, it still shows
the black on the back!
=<Code>=============
this->vehicles[0].bmp = SDL_CreateRGBSurface(SDL_HWSURFACE, 96, 96,
32, 0, 0, 0, 0);
if (SDL_SetColorKey(this->vehicles[0].bmp, SDL_SRCCOLORKEY, 255) ==
-1) return false;
if (SDL_SetAlpha(this->vehicles[0].bmp, SDL_SRCALPHA, 128) == -1)
return false;
=</Code>============
How should it be? Thanks!
--
~ Leo, M@$73r L3170, Sulfurik, Kixdemp, L-28C... Whatever you wanna call me.
More information about the SDL
mailing list