SDL_OpenStorage(3)
π SDL_OpenStorage π
okay bestie, welcome to the SDL_OpenStorage(3) page from the SDL3 FUNCTIONS collection π this one's a lil niche but it's lowkey iconic if you're out here building your own storage backend, so let's get into it β¨
πΈ NAME πΈ
SDL_OpenStorage β opens up a container using a client-provided storage interface π«Ά
β¨ SYNOPSIS β¨
#include <SDL3/SDL_storage.h>
SDL_Storage * SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata);
π DESCRIPTION π
so here's the tea β β you do NOT need this function unless you're literally providing your own SDL_Storage implementation. like, if all you want is an SDL_Storage, pls just use the built-in implementations that SDL already ships, like SDL_OpenTitleStorage() or SDL_OpenUserStorage(). they exist, they're right there, use them π
the way this function works: it makes a copy of iface π«Ά so the caller does not need to keep it around after this call. you can let it go, bestie. it's safe. no cap.
π¦ FUNCTION PARAMETERS π¦
ifaceβ the interface that implements this storage, initialized usingSDL_INIT_INTERFACE(). yes, you gotta init it properly, don't skip that step πuserdataβ the pointer that will be passed to the interface functions. it just gets handed along, like a lil note you pass in class π
π RETURN VALUE π
Returns a storage container on success π or NULL on failure π β and if you get that NULL, call SDL_GetError() for more information, fr fr. always check your errors, it's giving responsible dev energy.
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something olderβ¦ girl, upgrade π
π SEE ALSO π
SDL_CloseStorage(3)SDL_GetStorageFileSize(3)SDL_GetStorageSpaceRemaining(3)SDL_INIT_INTERFACE(3)SDL_ReadStorageFile(3)SDL_StorageReady(3)SDL_WriteStorageFile(3)
and that's the whole page, bestie π this one came to you courtesy of Simple Directmedia Layer, version SDL 3.4.18 β mwah, go build something cute with it π§β¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms