Skip to content

SDL_SetWindowIcon for Emscripten #14478

@LloydJHowarth

Description

@LloydJHowarth

Using SDL_SetWindowIcon is a very convenient cross-platform way to handle window based icons.

When using (C#)

    var icon = SDL_image.Load(Path.Combine(SDL.GetBasePath(), "Icon.png"));
    
    if (icon == null)
        throw new Exception("Failed to load icon: " + SDL.GetError());

    if (!SDL.SetWindowIcon(window, icon))
    {
        throw new Exception("Failed to set icon: " + SDL.GetError());
    }

There is an error:

System.Exception: Failed to set icon: That operation is not supported

We can load surfaces & textures through the Emscripten file system when using --embed-file so it would make sense to support this operation for Emscripten which should set the browser tab icon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions