IMG_LoadBMP_IO(3)
π IMG_LoadBMP_IO(3) β load a BMP, but like, directly
okay so this one lives in the SDL_image3 FUNCTIONS manual, section 3, and it's about that one specific little guy: IMG_LoadBMP_IO. come sit, bestie, it's quick π«Ά
β¨ SYNOPSIS β¨
#include <SDL3_image/SDL_image.h>
SDL_Surface * IMG_LoadBMP_IO(SDL_IOStream *src);
yes it's literally one function and one header, we love a low-effort slay π
πΈ DESCRIPTION πΈ
so here's the vibe: if you already know β like, deep in your soul, no doubts, fr fr β that the thing in front of you is a BMP image, you can call this function and it will skip SDL_image's file format detection routines entirely. no sniffing, no guessing, no "hmm what could this be" energy. straight in. π―
but like β generally it's better to use the abstract interfaces?? that's the actual advice, not me being dramatic. also, key detail: there is only an SDL_IOStream interface available here. so no filename version of this one, it's _IO or nothing π¦
π FUNCTION PARAMETERS π
srcβ anSDL_IOStreamto load image data from. that's it. that's the whole parameter. give it your stream, bestie π
β RETURN VALUE β
Returns an SDL surface, or NULL on error. so yeah, always check for NULL, no cap β a NULL return is not the main character you want showing up uninvited π
π AVAILABILITY π
This function is available since SDL_image 3.0.0. vintage-ish, but still iconic π
π¦ SEE ALSO π¦
the whole friend group, all the other _IO loaders β pick your fighter:
IMG_LoadAVIF_IO(3)IMG_LoadCUR_IO(3)IMG_LoadGIF_IO(3)IMG_LoadICO_IO(3)IMG_LoadJPG_IO(3)IMG_LoadJXL_IO(3)IMG_LoadLBM_IO(3)IMG_LoadPCX_IO(3)IMG_LoadPNG_IO(3)IMG_LoadPNM_IO(3)IMG_LoadQOI_IO(3)IMG_LoadSVG_IO(3)IMG_LoadTGA_IO(3)IMG_LoadTIF_IO(3)IMG_LoadWEBP_IO(3)IMG_LoadXCF_IO(3)IMG_LoadXPM_IO(3)IMG_LoadXV_IO(3)
ngl the real glow-up move is reaching for the abstract interfaces first and only whipping out IMG_LoadBMP_IO when you're certain. certainty is cute, guessing is not π
and that's the page!! πβ¨ this was brought to you by SDL_image 3.4.4 (the source/version in the footer, keeping it real) β the date slot down there is literally empty so ig we're ignoring it, the way it ignored us π mwah, go load some bitmaps, ily π«Άπ
π¦ where this page comes from
- ubuntu stonking: libsdl3-image-doc 3.4.4+ds-2 Β· zlib/libpng AND HPND-like AND zlib-like-permissive
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms