SDL_LoadBMP(3)
π SDL_LoadBMP(3) π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_LoadBMP β the one that loads a BMP image from a file. no cap. π
πΈ NAME πΈ
SDL_LoadBMP β load a BMP image from a file, periodt. π¦
β¨ SYNOPSIS β¨
#include <SDL3/SDL_surface.h>
SDL_Surface * SDL_LoadBMP(const char *file);
look at her. so simple. so iconic. π
π«Ά DESCRIPTION π«Ά
She gives you a brand-new surface loaded up from your BMP file, and she is literally handing it to you like a lil gift. π
IMPORTANT BESTIE: the new surface should be freed with SDL_DestroySurface(). not doing so will result in a memory leak. that's not a vibe, that's a slow-motion tragedy. π clean up after yourself, queen.
π FUNCTION PARAMETERS π
fileβ the BMP file to load. that's it. that's the whole job. she just wants the file, bestie. π
π RETURN VALUE π
Returns a pointer to a new SDL_Surface structure β slay β¨ β or NULL on failure. if you get NULL, do not panic, just call SDL_GetError() for more information. she'll tell you what went wrong. π«Ά
π THREAD SAFETY π
It is safe to call this function from any thread. yes, ANY. go wild. multithreaded icon behavior. π₯
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older... bestie. we need to talk. π
π¦ SEE ALSO π¦
SDL_DestroySurface(3)β the one you MUST call, remember? πSDL_LoadBMP_IO(3)SDL_SaveBMP(3)
and that's the whole page, bestie!! π this lil slice of documentation came to you courtesy of Simple Directmedia Layer, version SDL 3.4.18, dated SDL_LoadBMP(3) β mwah, 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