SDL_SetiOSAnimationCallback(3)
β¨ SDL_SetiOSAnimationCallback β¨
okay bestie, gather round, because we're talking about SDL_SetiOSAnimationCallback(3) from the SDL3 functions crew π this one's the "use this function to set the animation callback on Apple iOS" girlie. yes, that's literally what the NAME section says, and I would never lie to you π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_system.h>
bool SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
look at that signature, it's giving very much "hand me a window and I'll hand you a callback" π
π¦ DESCRIPTION π¦
so the function prototype for callback is this:
void callback(void *callbackParam);
and where its parameter, callbackParam, is what was passed as callbackParam to SDL_SetiOSAnimationCallback(). yes, the naming is doing the absolute most, but it's consistent so we love it π
This function is only available on Apple iOS. like, that's the whole vibe check. not Linux, not Windows, not your friend's weird BSD box. iOS only, periodt π
want more info? it's right here:
https://wiki.libsdl.org/SDL3/README-ios
also!! a little heads up: if you use the "main callbacks" instead of a standard C main function, you don't have to use this API, as SDL will manage this for you. SDL's got you, bestie, it's literally carrying the whole thing so you don't have to π
details on main callbacks are here:
https://wiki.libsdl.org/SDL3/README-main-functions
π FUNCTION PARAMETERS π
windowβ the window for which the animation callback should be set. your canvas, your main character πͺβ¨intervalβ the number of frames after whichcallbackwill be called. so not every frame, every interval frames. math girlies rise π§callbackβ the function to call for every frame. yes, this is the actual star of the show, the callback of the hour πcallbackParamβ a pointer that is passed tocallback. your little care package of custom data π
π RETURN VALUE π
Returns true on success or false on failure β and if it fails, call SDL_GetError() for more information. don't just sit there guessing, ask SDL, she'll tell you π
π THREAD SAFETY π
This function should only be called on the main thread. main thread only, no exceptions, no side quests. the main character energy is mandatory here fr fr π
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older than 3.2.0, this is not your moment bestie, go update π
π₯ SEE ALSO π₯
SDL_SetiOSEventPump(3)β the sibling, the companion, the other iOS thing you probably want to peek at π«Ά
okay that's the whole page!! no cap, we covered every single thing: the header lives up top (that's the SDL3 FUNCTIONS crew, hi), and this little manual was served to you by Simple Directmedia Layer, rocking SDL 3.4.18, under the name SDL_SetiOSAnimationCallback(3) πΈ that's the footer, mwah, bye bestie, go set some animation callbacks πβ¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms