SDL_LoadBMP_IO(3)
π SDL_LoadBMP_IO(3) π
okay so bestie, welcome to SDL_LoadBMP_IO β the SDL3 FUNCTIONS girlie whose whole entire job is: load a BMP image from a seekable SDL data stream. that's it. that's the vibe. she eats, she serves, she reads your pixels off a stream. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_surface.h>
SDL_Surface * SDL_LoadBMP_IO(SDL_IOStream *src, bool closeio);
like look at her. two args. no drama. icon behavior fr fr π
πΈ DESCRIPTION πΈ
so she hands you back a shiny new surface, right? and the way that you are legally and morally obligated to give it back is SDL_DestroySurface(). no cap. if you don't do that? memory leak. your program just slowly leaking. it's giving slow villain arc π not the main character energy we want for you.
π«Ά free your surfaces, bestie. the computer will literally thank you.
π¦ FUNCTION PARAMETERS π¦
srcβ the data stream for the surface. this is your source, your origin story, the stream she's reading from. gotta be seekable, iykyk.closeioβ iftrue, she callsSDL_CloseIO()onsrcbefore returning, even in the case of an error. yes even then. especially then. she's thorough like that. if you passfalseshe leaves the stream open and it's yours to deal with. choose wisely π
β RETURN VALUE β
returns a pointer to a brand new SDL_Surface structure, or NULL on failure. and if you get NULL, don't just sit there β call SDL_GetError() for more information. she will tell you what went wrong. she's not mysterious, she's just waiting for you to ask π
π§ THREAD SAFETY π§
it is safe to call this function from any thread. any. thread. go wild. parallelize. slay across cores π₯
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on something older, bestie, that's a you problem and an upgrade problem π
π SEE ALSO π
go read those too, they're all in the same friend group π«Ά
and that's the whole page, no notes. this one came to you from Simple Directmedia Layer, running SDL 3.4.18, dated SDL_LoadBMP_IO(3) β yeah the footer's just the same name again, she's consistent like that β¨ bye bestie, go free your surfaces π
π¦ 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