SDL_SavePNG_IO(3)

πŸ“¦
version 3.4.18 Β· 5 versions
, in fedora 43, fedora 44

πŸ’Ύ SDL_SavePNG_IO(3) πŸ’Ύ

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_SavePNG_IO πŸŽ€


✨ NAME ✨

SDL_SavePNG_IO β€” save a surface to a seekable SDL data stream in PNG format πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_surface.h>

bool SDL_SavePNG_IO(SDL_Surface *surface, SDL_IOStream *dst, bool closeio);

✨ FUNCTION PARAMETERS ✨

  • surface β€” the SDL_Surface structure holding the image you wanna save πŸ–ΌοΈ
  • dst β€” a data stream to save to 🌊
  • closeio β€” if true, it calls SDL_CloseIO() on dst before returning, even in the case of an error 😭 like it's closing that door no matter what happens next, fr fr

✨ RETURN VALUE ✨

Returns true on success or false on failure 🫠 and if it's giving failure, call SDL_GetError() for more information πŸ‘‘


✨ THREAD SAFETY ✨

This function can be called on different threads with different surfaces 🧚✨ so yes, you can absolutely parallelize this, just keep the surfaces separate, iykyk πŸ’œ


✨ AVAILABILITY ✨

This function is available since SDL 3.4.0 πŸŽ€


✨ SEE ALSO ✨


bestie reminder: dst has to be seekable, that's not a suggestion, that's the vibe check 🌸

and that's the whole page, no cap πŸ’– this one came to you from Simple Directmedia Layer, version SDL 3.4.18 πŸ¦‹ mwah, go save some PNGs, you ate πŸ’…βœ¨

πŸ“¦ where this page comes from