Skip to content

Add Window::setIcon() to set window icon#286

Merged
daid merged 2 commits intodaid:masterfrom
oznogon:window-icon
Mar 2, 2026
Merged

Add Window::setIcon() to set window icon#286
daid merged 2 commits intodaid:masterfrom
oznogon:window-icon

Conversation

@oznogon
Copy link
Contributor

@oznogon oznogon commented Dec 25, 2025

Set the window icon that appears in the title bar and taskbar using SDL_SetWindowIcon, which requires an SDL_Surface. Pass the path of a BMP to setIcon() to load it as the SDL_Surface. Load the icon as a ResourceStream into an sp::Image and convert it to a compatible SDL_Surface using SDL_CreateRGBSurfaceWithFormatFrom.

Set the window icon that appears in the title bar and taskbar
using SDL_SetWindowIcon, which requires an SDL_Surface. Pass the
path of a BMP to setIcon() to load it as the SDL_Surface.
@oznogon oznogon changed the title Add Window::setIcon() to set window icon [#1667] Add Window::setIcon() to set window icon Dec 25, 2025
@oznogon oznogon changed the title [#1667] Add Window::setIcon() to set window icon Add Window::setIcon() to set window icon Dec 25, 2025
@oznogon oznogon requested a review from daid February 26, 2026 16:33
@daid daid merged commit 7bf2606 into daid:master Mar 2, 2026
6 checks passed
@oznogon oznogon deleted the window-icon branch March 2, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants