SDL Wiki
[ front page | index | search | recent changes | git repo | offline html ]
(This function is part of SDL_image, a separate library from SDL.)

IMG_GetNextAnimationDecoderFrame

Get the next frame in an animation decoder.

Header File

Defined in <SDL3_image/SDL_image.h>

Syntax

bool IMG_GetNextAnimationDecoderFrame(IMG_AnimationDecoder *decoder, SDL_Surface** frame, Sint64* pts);

Function Parameters

IMG_AnimationDecoder * decoder the animation decoder.
Sint64 * pts a pointer to a Sint64 variable that will be set to the presentation timestamp of the frame, in milliseconds.

Return Value

(bool) Returns a new SDL_Surface containing the decoded frame, or NULL on error; call SDL_GetError() for more information.

Remarks

This function decodes the next frame in the animation decoder, returning it as an SDL_Surface. The returned surface should be freed with SDL_FreeSurface() when no longer needed.

If the animation decoder has no more frames, this function returns NULL and only sets the error if the decoding has failed.

Version

This function is available since SDL_image 3.4.0.

See Also


CategoryAPI, CategoryAPIFunction, CategorySDLImage


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.