Jump to content
  • Advertisement
Sign in to follow this  

SDL Icon Issue

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

I'm having an issue with both the Windows and Linux builds of my project. It's small, but I'd like to get it dealt with for polish. The problem is that I assign an icon for the window, but no matter what the window always has the default Icon. I've tried looking online to no avail, so I was curious if anyone here might have any insight. This is the function I'm using.
SDL_Surface* Window_Initialize( std::string strCaption, std::string strFilename )

    if( surScreen == NULL )
        return NULL;

    SDL_Surface* surIcon = Load_Image( strFilename );

    SDL_WM_SetCaption( &strCaption[0], &strCaption[0] );
    SDL_WM_SetIcon( surIcon, NULL );

    SDL_FreeSurface( surIcon );
    return surScreen;

Share this post

Link to post
Share on other sites
According to the SDL_WM_SetIcon documentation:

This function must be called before the first call to SDL_SetVideoMode. Note that this means SDL_Image cannot be used.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!