Skip to content

Inconsistent Emscripten behavior when rendering from non-alpha PNG to RGBA texture with SDL_BLENDMODE_BLEND #497

@pshaughn

Description

@pshaughn

I'm not really sure whether this is an SDL renderer issue or an SDL_image one, but it's only manifested for me as the result of a sequence of steps involving loading a PNG from a file.

I used IMG_LoadTyped_IO to load a PNG that had no alpha channel into a surface, then SDL_CreateTextureFromSurface to make a texture.

My rendering target is a SDL_PIXELFORMAT_RGBA32 texture, and I'm in SDL_BLENDMODE_BLEND. When I call SDL_RenderTexture to draw that texture that I'd loaded, the result varies: it draws at full opacity in a Windows executable, and in an Emscripten webapp if I'm running it in Firefox, but it draws nothing if I'm running the same Emscripten webapp in Chromium.

For my own current purposes, I can easily work around this by just only using PNGs that have an alpha channel in the first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions