Skip to content

Feature: Add SDL_PhysFS_IOFromFileWrite to expose a writable SDL_IOStream #19

Description

@RobLoach

The only write API is the one-shot SDL_PhysFS_WriteFile. There is no way to get a writable SDL_IOStream* that callers can pass to SDL_SaveBMP_IO, Mix_SaveWAV_IO, or other SDL functions that consume a stream. The internal SDL_PhysFS_OpenIO already supports writes — it just needs a public constructor that opens a PHYSFS_File for writing.

Suggested Implementation

SDL_IOStream* SDL_PhysFS_IOFromFileWrite(const char* filename);
// opens PHYSFS_openWrite(filename), wraps with SDL_PhysFS_OpenIO

An append-mode variant (SDL_PhysFS_IOFromFileAppend) could follow the same pattern using PHYSFS_openAppend.

QA

Test: open a write stream, write bytes via SDL_WriteIO, close, verify with SDL_PhysFS_LoadFile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions