{"id":13534825,"url":"https://github.com/RobLoach/SDL_PhysFS","last_synced_at":"2025-04-02T00:30:47.410Z","repository":{"id":66036516,"uuid":"456279960","full_name":"RobLoach/SDL_PhysFS","owner":"RobLoach","description":"PhysFS virtual file system support for SDL to load assets from .zip files.","archived":false,"fork":false,"pushed_at":"2023-09-07T14:44:15.000Z","size":185,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-16T08:36:31.735Z","etag":null,"topics":["physfs","sdl","sdl2","single-header"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobLoach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-02-06T21:43:48.000Z","updated_at":"2024-02-01T11:23:48.000Z","dependencies_parsed_at":"2024-01-16T15:49:13.184Z","dependency_job_id":null,"html_url":"https://github.com/RobLoach/SDL_PhysFS","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2FSDL_PhysFS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2FSDL_PhysFS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2FSDL_PhysFS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2FSDL_PhysFS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobLoach","download_url":"https://codeload.github.com/RobLoach/SDL_PhysFS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222784453,"owners_count":17037192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["physfs","sdl","sdl2","single-header"],"created_at":"2024-08-01T08:00:43.381Z","updated_at":"2025-04-02T00:30:47.397Z","avatar_url":"https://github.com/RobLoach.png","language":"C","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"# SDL_PhysFS\n\n[PhysicsFS](https://github.com/icculus/physfs) is a portable flexible file I/O abstraction library. `SDL_PhysFS` builds upon [PhysFS's physfsrwops.h](https://github.com/icculus/physfs/blob/main/extras/physfsrwops.h) to ease the integration between SDL and PhysFS to load assets from *.zip* files.\n\n## Dependencies\n\n- [SDL](https://github.com/libsdl-org/SDL) 3.x\n  - For SDL 2, see the [2.x branch](https://github.com/RobLoach/SDL_PhysFS/tree/2.x)\n- [PhysFS](https://github.com/icculus/physfs)\n\n## Example\n\n``` c\n#include \u003cSDL3/SDL.h\u003e\n\n#define SDL_PHYSFS_IMPLEMENTATION\n#include \"SDL_PhysFS.h\"\n\nint main() {\n    SDL_Init(SDL_INIT_EVERYTHING);\n\n    // Initialize PhysFS\n    SDL_PhysFS_Init(0);\n\n    // Mount\n    SDL_PhysFS_Mount(\"assets.zip\", \"assets\");\n\n    // Load a surface from assets.zip\n    SDL_Surface* dog = SDL_PhysFS_LoadBMP(\"assets/dog.bmp\");\n\n    // Clean up\n    SDL_PhysFS_Quit();\n    SDL_Quit();\n\n    return 0;\n}\n```\n\n### API\n\n``` c\nSDL_bool SDL_PhysFS_Init();\nSDL_bool SDL_PhysFS_InitEx(const char* org, const char* app);\nSDL_bool SDL_PhysFS_Quit();\nSDL_bool SDL_PhysFS_Mount(const char* newDir, const char* mountPoint);\nSDL_bool SDL_PhysFS_MountFromMemory(const unsigned char *fileData, int dataSize, const char* newDir, const char* mountPoint);\nSDL_bool SDL_PhysFS_Unmount(const char* oldDir);\nSDL_RWops* SDL_PhysFS_RWFromFile(const char* filename);\nSDL_Surface* SDL_PhysFS_LoadBMP(const char* filename);\nSDL_AudioSpec* SDL_PhysFS_LoadWAV(const char* filename, SDL_AudioSpec * spec, Uint8 ** audio_buf, Uint32 * audio_len);\nvoid* SDL_PhysFS_LoadFile(const char* filename, size_t *datasize);\nsize_t SDL_PhysFS_Write(const char* file, const void* buffer, size_t size);\nSDL_bool SDL_PhysFS_SetWriteDir(const char* path);\nchar** SDL_PhysFS_LoadDirectoryFiles(const char *directory);\nvoid SDL_PhysFS_FreeDirectoryFiles(char** files);\nSDL_bool SDL_PhysFS_Exists(const char* file);\n\n// Optional Integrations\nSDL_Surface* SDL_PhysFS_IMG_Load(const char* filename);    // SDL_image\nMix_Music* SDL_PhysFS_Mix_LoadMUS(const char* filename);   // SDL_mixer\nTTF_Font* SDL_PhysFS_TTF_OpenFont(const char* filename, int ptsize); // SDL_ttf\nSDL_Surface* SDL_PhysFS_STBIMG_Load(const char* filename); // SDL_stbimage.h\n```\n\n## License\n\n[zlib](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobLoach%2FSDL_PhysFS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRobLoach%2FSDL_PhysFS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobLoach%2FSDL_PhysFS/lists"}