IMG_LoadAnimation_IO(3)

πŸ’– NAME πŸ’–

okay bestie, welcome to the IMG_LoadAnimation_IO(3) page from the SDL_image3 FUNCTIONS manual ✨ and it's literally about how to load an animation from an SDL_IOStream. main character energy only πŸ’…

✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

IMG_Animation * IMG_LoadAnimation_IO(SDL_IOStream *src, bool closeio);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: if closeio is true, src will be closed before returning β€” and yes, that's whether this function succeeds or not. No cap. SDL_image reads everything it needs from src during this call in any case, so it's not gonna be like "wait, I still need that stream later" β€” it's giving self-sufficient.

When you're done with the returned animation, the app should dispose of it with a call to IMG_FreeAnimation(). Please don't ghost your animations, bestie β€” free them 🫢

🌸 FUNCTION PARAMETERS 🌸

  • src β€” an SDL_IOStream that data will be read from.
  • closeio β€” true to close/free the SDL_IOStream before returning, false to leave it open.

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns a new IMG_Animation, or NULL on error. Iconic when it works, NULL when it doesn't 😭

⭐ AVAILABILITY ⭐

This function is available since SDL_image 3.0.0 🌈

🌈 SEE ALSO 🌈


πŸ’– cute little sign-off flex: this page is from SDL_image, version 3.4.4 β€” and the footer doesn't list a date, so I'm not inventing one, bestie. periodt πŸ’…πŸŽ€

πŸ“¦ where this page comes from