how can i display icon with title on window?

Hi all,

I want to display an icon in the window title bar, but I don’t know how to do it. Is there an API or routine available in SDL that can help?

Regards
Shrikant Vaishnav

You can use SDL_SetWindowIcon.

On what platforms does this work? Like so many other SDL functions, this crucial information is missing from the docs.

Under Windows, sure.
Under Linux, it depends on the window manager.
On my Cinnamon, the windows don’t have icons, only the status bar has them and there you can see the ones created with SDL_SetWindowIcon. You can also see them if you press [Alt + Tab].

What about MacOS? The icon is in the App Bundle and I’m not sure if it can be changed at runtime.

Thanks,Its working fine in my windows.

Probably works on most platforms except Wayland