IMG_LoadTGA_IO(3)
π IMG_LoadTGA_IO(3) β like, the TGA loader, bestie π
okay so real talk β this is a page from SDL_image3 FUNCTIONS, and it's all about IMG_LoadTGA_IO. she's niche, she's direct, she's got main character energy for exactly one file format. let's get into it π
β¨ NAME β¨
IMG_LoadTGA_IO β load a TGA image directly, no detours, no drama π
πΈ SYNOPSIS πΈ
#include <SDL3_image/SDL_image.h>
SDL_Surface * IMG_LoadTGA_IO(SDL_IOStream *src);
that's it. that's the whole vibe. one include, one function, one SDL_IOStream *. slay β¨
π¦ DESCRIPTION π¦
okay so picture this: you already know you're holding a TGA image. like, you're not guessing, you're not doing a vibe check on the file header, you just know. in that case you can call this function, and it will skip SDL_image's file format detection routines entirely. no sniffing, no guessing, straight to business. iconic behavior honestly π
but ngl, generally it's better to use the abstract interfaces instead β that's the recommended move, fr fr. also, heads up: there is only an SDL_IOStream interface available here. that's the one and only option, no alternates, no ..._RW twin, periodt.
π FUNCTION PARAMETERS π
srcβ anSDL_IOStreamto load the image data from. that's your source, your plug, your stream of image-y goodness π«Ά
β RETURN VALUE β
Returns an SDL_Surface β your freshly loaded image, gorgeous π
or NULL on error π (check your errors, bestie, don't just assume it worked)
π AVAILABILITY π
this function is available since SDL_image 3.0.0 β so if you're on anything older, she is not there for you, sorry π
π SEE ALSO π
the whole IO-loading friend group, all here, all iconic:
IMG_LoadAVIF_IO(3)IMG_LoadBMP_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_LoadTIF_IO(3)IMG_LoadWEBP_IO(3)IMG_LoadXCF_IO(3)IMG_LoadXPM_IO(3)IMG_LoadXV_IO(3)
lowkey the whole point: if you definitely have a TGA, this skips format detection and goes straight there. but abstract interfaces are still the better call in general β no cap π
and that's the page!! brought to you by SDL_image, version SDL_image 3.4.4, filed under IMG_LoadTGA_IO(3) in the SDL_image 3 docs. mwah, go load some TGAs bestie π§ββοΈπβ¨
π¦ 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