IMG_SaveTGA_IO(3)
πΎ IMG_SaveTGA_IO(3) β the SDL_image3 girlies' guide πΎ
okay bestie, so you know how we've been saving TGA files but you're working with an SDL_IOStream instead of a plain filename? yeah. this is that one. it's IMG_SaveTGA_IO, and it lives in the SDL_image3 FUNCTIONS family. let's get into it π«Ά
β¨ NAME β¨
IMG_SaveTGA_IO β save an SDL_Surface into TGA image data, via an SDL_IOStream. no cap, that's the whole vibe.
πΈ SYNOPSIS πΈ
#include <SDL3_image/SDL_image.h>
bool IMG_SaveTGA_IO(SDL_Surface *surface, SDL_IOStream *dst, bool closeio);
π DESCRIPTION π
so like, if you literally just wanna save to a filename and you're not out here doing stream gymnastics? you can use IMG_SaveTGA() instead. that's the simpler sister function, iykyk. π
now here's the part that MATTERS, bestie, pay attention:
if closeio is true, then dst will be closed before returning β and that's true whether this function succeeds or not. the way that it doesn't care about the outcome, it's closing that stream either way. periodt. π
π¦ FUNCTION PARAMETERS π¦
surfaceβ theSDL_Surfaceyou wanna save. your art. your masterpiece. πdstβ theSDL_IOStreamwhere the image data is going. the destination, the moment.closeioβ pass true to close/free theSDL_IOStreambefore returning, or false to leave it open. your call, main character. β
π RETURN VALUE π
returns true on success or false on failure β and if it's giving failure, hit up SDL_GetError() for more info. that's your bestie who always tells you what actually went wrong. π
β AVAILABILITY β
this one's been around since SDL_image 3.4.0. so if you're on something older than that, no TGA stream saving for you, sorry babe. π
π SEE ALSO π
IMG_SaveTGA(3)β the filename-flavored version, go say hi π
lowkey reminder: that closeio thing is a commitment. once it's true, that stream is getting closed no matter how things shake out. know that before you hand it over. π
okay that's the whole page, you ate it, you understood it, iconic behavior truly. this was SDL_image 3.4.8, and yes the date on the original footer was the same as always because they're cute like that. mwah. πβ¨π
π¦ where this page comes from
- fedora 43: SDL3_image-devel 3.4.8-1.fc43 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- fedora 43: SDL3_image-devel 3.4.8-1.fc43 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- fedora 44: SDL3_image-devel 3.4.8-1.fc44 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- fedora 44: SDL3_image-devel 3.4.8-1.fc44 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms