Sign in to follow this  
badwolf

SDL_WM_SetIcon

Recommended Posts

When I use SDL_WM_SetIcon to set the window icon, the icon only appears in my taskbar and not in the title bar. I'm trying to find out if SDL even supports setting the icon that appears in the title bar.

Share this post


Link to post
Share on other sites
It works for me. Make sure you have the icon loading from the right file.

Here is an example (I haven't compiled it)


SDL_Surface *screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);

SDL_WM_SetCaption("Name of title", "Name of icon title");
SDL_WM_SetIcon("Name of icon title", NULL);

Share this post


Link to post
Share on other sites
Quote:
Description
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, the shape is determined by the colorkey or alpha channel of the icon, if any. If neither of those are present, the icon is made opaque (no transparency).

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.


So you have to set the icon before you set up your window.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this