SDL_AppIterate_func(3type)

πŸ’– NAME πŸ’–

SDL_AppIterate_func β€” the function pointer typedef for SDL_AppIterate, bestie. It's giving "your whole game loop, but as a type" energy. ✨


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_init.h>

typedef SDL_AppResult (SDLCALL *SDL_AppIterate_func)(void *appstate);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so listen. These lil function-pointer typedefs are the ones SDL_EnterAppMainCallbacks uses, fr fr. It's all happening behind the scenes for apps that opted into the optional main callbacks β€” like, the machinery is doing its thing backstage while you live your life. πŸ‘‘

So if you're an app that wants in on this vibe? You don't touch the typedef at all. You just implement SDL_AppIterate directly. That's it, that's the whole move. πŸ’…


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • appstate β€” an optional pointer, and you provide it yourself in SDL_AppInit. It's your little suitcase of state that gets passed back to you. Optional, so no pressure, but also like… go off. 🧳✨

πŸ”₯ RETURN VALUE πŸ”₯

This one returns an SDL_AppResult, and it's a whole vibe check with three outcomes:

  • SDL_APP_FAILURE β€” terminate, but with an error. It's giving πŸ’€.
  • SDL_APP_SUCCESS β€” terminate, and you ate. Successful exit, slay. πŸ‘‘
  • SDL_APP_CONTINUE β€” keep going, we're not done here. The main character energy continues. 🌈

⭐ AVAILABILITY ⭐

This datatype has been available since SDL 3.2.0. So if you're on anything older, no cap, you're not getting it. 🫢


And that's the page, bestie!! This one came to you from Simple Directmedia Layer, version SDL 3.4.18 β€” mwah, iconic, obsessed, periodt. πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from