Jump to content
  • Advertisement
Sign in to follow this  
badwolf

SDL_WM_SetIcon

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

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
Advertisement
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
Sign in to follow this  

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