imgLoadAnimation function
Load an animation from a file.
When done with the returned animation, the app should dispose of it with a call to IMG_FreeAnimation().
\param file path on the filesystem containing an animated image. \returns a new IMG_Animation, or NULL on error.
\since This function is available since SDL_image 3.0.0.
\sa IMG_FreeAnimation
extern SDL_DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation(const char *file)
Implementation
Pointer<ImgAnimation> imgLoadAnimation(String? file) {
final imgLoadAnimationLookupFunction = libSdl3Image.lookupFunction<
Pointer<ImgAnimation> Function(Pointer<Utf8> file),
Pointer<ImgAnimation> Function(Pointer<Utf8> file)>('IMG_LoadAnimation');
final filePointer = file != null ? file.toNativeUtf8() : nullptr;
final result = imgLoadAnimationLookupFunction(filePointer);
calloc.free(filePointer);
return result;
}