SDL_main_func(3type)

✨ NAME ✨

SDL_main_func β€” bestie, it's literally just the prototype for your app's main() function πŸ’…

So like, this is the SDL3 DATATYPES section of the manual, and we're about to get into the whole vibe of how SDL wants you to declare your main character entry point. No cap. πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_main.h>

typedef int (SDLCALL *SDL_main_func)(int argc, char *argv[]);

That's the whole thing. She's a function pointer typedef and she ate. πŸ‘‘


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • argc β€” the argc of an ANSI-C style main function, fr fr. Same energy as always.
  • argv β€” the argv of an ANSI-C style main function. Also exactly what you think it is, no surprises here bestie πŸ’–

🌈 RETURN VALUE 🌈

Returns an ANSI-C main return code. So like β€” generally 0 means the program finished successfully, and small non-zero values are considered errors. That's the whole rule, periodt. ⭐


πŸ’œ AVAILABILITY πŸ’œ

This datatype has been available since SDL 3.2.0. So if you're on anything older, sorry bestie, she's not there yet 😭


And that's a wrap on the SDL_main_func(3type) page, brought to you by the fine folks at Simple Directmedia Layer, running the SDL 3.4.18 era πŸ’– if you needed this page again later, it lives in section 3type β€” iykyk 🫢✨

πŸ“¦ where this page comes from