In Bug Squish (in fact, most of my games), I create a 100% opaque mask
for the square-shaped icon I used:
int masklen;
Uint8 * mask;
SDL_Surface * icon;
…
/* Load icon from PNG: */
icon = IMG_Load(“icon.png”);
/* Create mask: */
masklen = (((icon -> w) + 7) / 8) * (icon -> h);
mask = malloc(masklen * sizeof(Uint8));
memset(mask, 0xFF, masklen);
/* Set icon: */
SDL_WM_SetIcon(icon, mask);
/* Free icon surface & mask: */
free(mask);
SDL_FreeSurface(icon);
Some error checking would be good in there, too
I don’t think I’ve ever tried making an icon with any transparency, though.
Good luck!
-bill!On Tue, Sep 23, 2003 at 12:06:41PM +0300, Mika Halttunen wrote:
Greetings!
I know how to set a program icon with SDL_WM_SetIcon(), but what I don’t
know, is the mask thing. So, in what format should the mask be in etc.?
I tried with an Uint8 array [32*32], filling it with zeros and ones, but
it didn’t work.
–
bill at newbreedsoftware.com Got kids? Get Tux Paint!
http://newbreedsoftware.com/bill/ http://newbreedsoftware.com/tuxpaint/