Skip to content

Surface::from_data takes a mutable reference to the image data #672

Open
@jonas-schievink

Description

@jonas-schievink

It uses SDL_CreateRGBSurfaceFrom internally, whose first parameter is void*, but I see no reason (nor documentation) why it should change the data. It's probably a good idea to make it take a &[u8] instead of a &mut [u8], as that matches the expectation much better. If not, it should at least be documented why it needs mutable access.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions