SDL_LoadSurface_IO(3)
π SDL_LoadSurface_IO(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_LoadSurface_IO π
β¨ NAME β¨
SDL_LoadSurface_IO β load a BMP or PNG image from a seekable SDL data stream πΌοΈ
like, literally just "gimme the picture, and gimme it from a stream" π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_surface.h>
SDL_Surface * SDL_LoadSurface_IO(SDL_IOStream *src, bool closeio);
π¦ DESCRIPTION π¦
so you call this and it hands you back a whole new surface. cute, right? β¨
but listen β the new surface should be freed with SDL_DestroySurface(). Not doing so will result in a memory leak. and no, leaking is not a personality trait, bestie π free your surfaces, it's giving responsible queen behavior π
π FUNCTION PARAMETERS π
srcβ the data stream for the surface. that's the vibe source. the tea. the actual bytes πcloseioβ iftrue, it callsSDL_CloseIO()onsrcbefore returning, even in the case of an error. so like, if you're passingtrue, just know it's closing the door behind you no matter what happens on the way out π
β RETURN VALUE β
Returns a pointer to a new SDL_Surface structure, or NULL on failure β and if it flops, call SDL_GetError() for more information π no cap, that's where the actual reason lives.
π§ THREAD SAFETY π§
It is safe to call this function from any thread. multi-threaded and unbothered π β¨
π AVAILABILITY π
This function is available since SDL 3.4.0. so if you're on something older... not me finding out the hard way π
π SEE ALSO π
that's the whole page, periodt π go forth and load your surfaces, you absolute icon π«Άπ
Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_LoadSurface_IO(3) β mwah, thanks for reading, ily, bye bestie ππΈπ¦
π¦ 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