SDL_WM_SetIcon -- Sets the icon for the display window.


#include "SDL.h"

void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);


Sets the icon for the display window. Win32 icons must be 32x32.

This function must be called before the first call to SDL_SetVideoMode.

The mask is a bitmask that describes the shape of the icon. If mask is NULL, then the shape is determined by the colorkey of icon, if any, or makes the icon rectangular (no transparency) otherwise.

If mask is non-NULL, it points to a bitmap with bits set where the corresponding pixel should be visible. The format of the bitmap is as follows: Scanlines come in the usual top-down order. Each scanline consists of (width / 8) bytes, rounded up. The most significant bit of each byte represents the leftmost pixel.


SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), NULL);

See Also

SDL_SetVideoMode, SDL_WM_SetCaption