• Advertisement
Sign in to follow this  

C++ Change Window Icon

This topic is 740 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 know, that this theme got already discussed a lot of times but I now read over 4 hours and still I'm not able to get this working..


"All" I want to do is to set my custom icon for the window for all 3 cases (exe, tabmenu and real window icon (left top corner))


I found the doc from sdl, but there they are hardcoding the pixel values into a array and this I don't want..


I have a icon.png and this one I want to include in my window..

I installed sdl and sdl_image


Now I tried this:


SDL_Surface* surface = IMG_Load("icon.png");
// The icon is attached to the window pointer
SDL_SetWindowIcon(_sdlWindow, surface);

// ...and the surface containing the icon pixel data is no longer required.

But also this one doesn't work...


I would love it, if someone could say me, how I can do this...



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement