SDL 3.0
SDL_main.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/**
23 * # CategoryMain
24 *
25 * Redefine main() if necessary so that it is called by SDL.
26 *
27 * In order to make this consistent on all platforms, the application's main()
28 * should look like this:
29 *
30 * ```c
31 * int main(int argc, char *argv[])
32 * {
33 * }
34 * ```
35 *
36 * SDL will take care of platform specific details on how it gets called.
37 *
38 * For more information, see:
39 *
40 * https://wiki.libsdl.org/SDL3/README/main-functions
41 */
42
43#ifndef SDL_main_h_
44#define SDL_main_h_
45
47#include <SDL3/SDL_stdinc.h>
48#include <SDL3/SDL_error.h>
49#include <SDL3/SDL_events.h>
50
51#ifndef SDL_MAIN_HANDLED
52 #if defined(SDL_PLATFORM_PRIVATE_MAIN)
53 /* Private platforms may have their own ideas about entry points. */
54 #include "SDL_main_private.h"
55
56 #elif defined(SDL_PLATFORM_WIN32)
57 /* On Windows SDL provides WinMain(), which parses the command line and passes
58 the arguments to your main function.
59
60 If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
61 */
62 #define SDL_MAIN_AVAILABLE
63
64 #elif defined(SDL_PLATFORM_GDK)
65 /* On GDK, SDL provides a main function that initializes the game runtime.
66
67 If you prefer to write your own WinMain-function instead of having SDL
68 provide one that calls your main() function,
69 #define SDL_MAIN_HANDLED before #include'ing SDL_main.h
70 and call the SDL_RunApp function from your entry point.
71 */
72 #define SDL_MAIN_NEEDED
73
74 #elif defined(SDL_PLATFORM_IOS)
75 /* On iOS SDL provides a main function that creates an application delegate
76 and starts the iOS application run loop.
77
78 To use it, just #include SDL_main.h in the source file that contains your
79 main() function.
80
81 See src/video/uikit/SDL_uikitappdelegate.m for more details.
82 */
83 #define SDL_MAIN_NEEDED
84
85 #elif defined(SDL_PLATFORM_ANDROID)
86 /* On Android SDL provides a Java class in SDLActivity.java that is the
87 main activity entry point.
88
89 See docs/README-android.md for more details on extending that class.
90 */
91 #define SDL_MAIN_NEEDED
92
93 /* As this is launched from Java, the real entry point (main() function)
94 is outside of the the binary built from this code.
95 This define makes sure that, unlike on other platforms, SDL_main.h
96 and SDL_main_impl.h export an `SDL_main()` function (to be called
97 from Java), but don't implement a native `int main(int argc, char* argv[])`
98 or similar.
99 */
100 #define SDL_MAIN_EXPORTED
101
102 #elif defined(SDL_PLATFORM_EMSCRIPTEN)
103 /* On Emscripten, SDL provides a main function that converts URL
104 parameters that start with "SDL_" to environment variables, so
105 they can be used as SDL hints, etc.
106
107 This is 100% optional, so if you don't want this to happen, you may
108 define SDL_MAIN_HANDLED
109 */
110 #define SDL_MAIN_AVAILABLE
111
112 #elif defined(SDL_PLATFORM_PSP)
113 /* On PSP SDL provides a main function that sets the module info,
114 activates the GPU and starts the thread required to be able to exit
115 the software.
116
117 If you provide this yourself, you may define SDL_MAIN_HANDLED
118 */
119 #define SDL_MAIN_AVAILABLE
120
121 #elif defined(SDL_PLATFORM_PS2)
122 #define SDL_MAIN_AVAILABLE
123
124 #define SDL_PS2_SKIP_IOP_RESET() \
125 void reset_IOP(); \
126 void reset_IOP() {}
127
128 #elif defined(SDL_PLATFORM_3DS)
129 /*
130 On N3DS, SDL provides a main function that sets up the screens
131 and storage.
132
133 If you provide this yourself, you may define SDL_MAIN_HANDLED
134 */
135 #define SDL_MAIN_AVAILABLE
136
137 #elif defined(SDL_PLATFORM_NGAGE)
138 /*
139 TODO: not sure if it should be SDL_MAIN_NEEDED, in SDL2 ngage had a
140 main implementation, but wasn't mentioned in SDL_main.h
141 */
142 #define SDL_MAIN_AVAILABLE
143
144 #endif
145#endif /* SDL_MAIN_HANDLED */
146
147#ifdef SDL_MAIN_EXPORTED
148/* We need to export SDL_main so it can be launched from external code,
149 like SDLActivity.java on Android */
150#define SDLMAIN_DECLSPEC SDL_DECLSPEC
151#else
152/* usually this is empty */
153#define SDLMAIN_DECLSPEC
154#endif /* SDL_MAIN_EXPORTED */
155
156#ifdef SDL_WIKI_DOCUMENTATION_SECTION
157
158/**
159 * Inform SDL to use the main callbacks instead of main.
160 *
161 * SDL does not define this macro, but will check if it is defined when
162 * including `SDL_main.h`. If defined, SDL will expect the app to provide
163 * several functions: SDL_AppInit, SDL_AppEvent, SDL_AppIterate, and
164 * SDL_AppQuit. The app should not provide a `main` function in this case, and
165 * doing so will likely cause the build to fail.
166 *
167 * Please see [README/main-functions](README/main-functions), (or
168 * docs/README-main-functions.md in the source tree) for a more detailed
169 * explanation.
170 *
171 * \since This macro is used by the headers since SDL 3.1.3.
172 *
173 * \sa SDL_AppInit
174 * \sa SDL_AppEvent
175 * \sa SDL_AppIterate
176 * \sa SDL_AppQuit
177 */
178#define SDL_MAIN_USE_CALLBACKS 1
179#endif
180
181#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) || defined(SDL_MAIN_USE_CALLBACKS)
182#define main SDL_main
183#endif
184
185#include <SDL3/SDL_init.h>
186#include <SDL3/SDL_begin_code.h>
187#ifdef __cplusplus
188extern "C" {
189#endif
190
191/*
192 * You can (optionally!) define SDL_MAIN_USE_CALLBACKS before including
193 * SDL_main.h, and then your application will _not_ have a standard
194 * "main" entry point. Instead, it will operate as a collection of
195 * functions that are called as necessary by the system. On some
196 * platforms, this is just a layer where SDL drives your program
197 * instead of your program driving SDL, on other platforms this might
198 * hook into the OS to manage the lifecycle. Programs on most platforms
199 * can use whichever approach they prefer, but the decision boils down
200 * to:
201 *
202 * - Using a standard "main" function: this works like it always has for
203 * the past 50+ years in C programming, and your app is in control.
204 * - Using the callback functions: this might clean up some code,
205 * avoid some #ifdef blocks in your program for some platforms, be more
206 * resource-friendly to the system, and possibly be the primary way to
207 * access some future platforms (but none require this at the moment).
208 *
209 * This is up to the app; both approaches are considered valid and supported
210 * ways to write SDL apps.
211 *
212 * If using the callbacks, don't define a "main" function. Instead, implement
213 * the functions listed below in your program.
214 */
215#ifdef SDL_MAIN_USE_CALLBACKS
216
217/**
218 * App-implemented initial entry point for SDL_MAIN_USE_CALLBACKS apps.
219 *
220 * Apps implement this function when using SDL_MAIN_USE_CALLBACKS. If using a
221 * standard "main" function, you should not supply this.
222 *
223 * This function is called by SDL once, at startup. The function should
224 * initialize whatever is necessary, possibly create windows and open audio
225 * devices, etc. The `argc` and `argv` parameters work like they would with a
226 * standard "main" function.
227 *
228 * This function should not go into an infinite mainloop; it should do any
229 * one-time setup it requires and then return.
230 *
231 * The app may optionally assign a pointer to `*appstate`. This pointer will
232 * be provided on every future call to the other entry points, to allow
233 * application state to be preserved between functions without the app needing
234 * to use a global variable. If this isn't set, the pointer will be NULL in
235 * future entry points.
236 *
237 * If this function returns SDL_APP_CONTINUE, the app will proceed to normal
238 * operation, and will begin receiving repeated calls to SDL_AppIterate and
239 * SDL_AppEvent for the life of the program. If this function returns
240 * SDL_APP_FAILURE, SDL will call SDL_AppQuit and terminate the process with
241 * an exit code that reports an error to the platform. If it returns
242 * SDL_APP_SUCCESS, SDL calls SDL_AppQuit and terminates with an exit code
243 * that reports success to the platform.
244 *
245 * This function is called by SDL on the main thread.
246 *
247 * \param appstate a place where the app can optionally store a pointer for
248 * future use.
249 * \param argc the standard ANSI C main's argc; number of elements in `argv`.
250 * \param argv the standard ANSI C main's argv; array of command line
251 * arguments.
252 * \returns SDL_APP_FAILURE to terminate with an error, SDL_APP_SUCCESS to
253 * terminate with success, SDL_APP_CONTINUE to continue.
254 *
255 * \since This function is available since SDL 3.1.3.
256 *
257 * \sa SDL_AppIterate
258 * \sa SDL_AppEvent
259 * \sa SDL_AppQuit
260 */
261extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]);
262
263/**
264 * App-implemented iteration entry point for SDL_MAIN_USE_CALLBACKS apps.
265 *
266 * Apps implement this function when using SDL_MAIN_USE_CALLBACKS. If using a
267 * standard "main" function, you should not supply this.
268 *
269 * This function is called repeatedly by SDL after SDL_AppInit returns 0. The
270 * function should operate as a single iteration the program's primary loop;
271 * it should update whatever state it needs and draw a new frame of video,
272 * usually.
273 *
274 * On some platforms, this function will be called at the refresh rate of the
275 * display (which might change during the life of your app!). There are no
276 * promises made about what frequency this function might run at. You should
277 * use SDL's timer functions if you need to see how much time has passed since
278 * the last iteration.
279 *
280 * There is no need to process the SDL event queue during this function; SDL
281 * will send events as they arrive in SDL_AppEvent, and in most cases the
282 * event queue will be empty when this function runs anyhow.
283 *
284 * This function should not go into an infinite mainloop; it should do one
285 * iteration of whatever the program does and return.
286 *
287 * The `appstate` parameter is an optional pointer provided by the app during
288 * SDL_AppInit(). If the app never provided a pointer, this will be NULL.
289 *
290 * If this function returns SDL_APP_CONTINUE, the app will continue normal
291 * operation, receiving repeated calls to SDL_AppIterate and SDL_AppEvent for
292 * the life of the program. If this function returns SDL_APP_FAILURE, SDL will
293 * call SDL_AppQuit and terminate the process with an exit code that reports
294 * an error to the platform. If it returns SDL_APP_SUCCESS, SDL calls
295 * SDL_AppQuit and terminates with an exit code that reports success to the
296 * platform.
297 *
298 * This function is called by SDL on the main thread.
299 *
300 * \param appstate an optional pointer, provided by the app in SDL_AppInit.
301 * \returns SDL_APP_FAILURE to terminate with an error, SDL_APP_SUCCESS to
302 * terminate with success, SDL_APP_CONTINUE to continue.
303 *
304 * \threadsafety This function may get called concurrently with SDL_AppEvent()
305 * for events not pushed on the main thread.
306 *
307 * \since This function is available since SDL 3.1.3.
308 *
309 * \sa SDL_AppInit
310 * \sa SDL_AppEvent
311 */
312extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppIterate(void *appstate);
313
314/**
315 * App-implemented event entry point for SDL_MAIN_USE_CALLBACKS apps.
316 *
317 * Apps implement this function when using SDL_MAIN_USE_CALLBACKS. If using a
318 * standard "main" function, you should not supply this.
319 *
320 * This function is called as needed by SDL after SDL_AppInit returns
321 * SDL_APP_CONTINUE. It is called once for each new event.
322 *
323 * There is (currently) no guarantee about what thread this will be called
324 * from; whatever thread pushes an event onto SDL's queue will trigger this
325 * function. SDL is responsible for pumping the event queue between each call
326 * to SDL_AppIterate, so in normal operation one should only get events in a
327 * serial fashion, but be careful if you have a thread that explicitly calls
328 * SDL_PushEvent. SDL itself will push events to the queue on the main thread.
329 *
330 * Events sent to this function are not owned by the app; if you need to save
331 * the data, you should copy it.
332 *
333 * This function should not go into an infinite mainloop; it should handle the
334 * provided event appropriately and return.
335 *
336 * The `appstate` parameter is an optional pointer provided by the app during
337 * SDL_AppInit(). If the app never provided a pointer, this will be NULL.
338 *
339 * If this function returns SDL_APP_CONTINUE, the app will continue normal
340 * operation, receiving repeated calls to SDL_AppIterate and SDL_AppEvent for
341 * the life of the program. If this function returns SDL_APP_FAILURE, SDL will
342 * call SDL_AppQuit and terminate the process with an exit code that reports
343 * an error to the platform. If it returns SDL_APP_SUCCESS, SDL calls
344 * SDL_AppQuit and terminates with an exit code that reports success to the
345 * platform.
346 *
347 * \param appstate an optional pointer, provided by the app in SDL_AppInit.
348 * \param event the new event for the app to examine.
349 * \returns SDL_APP_FAILURE to terminate with an error, SDL_APP_SUCCESS to
350 * terminate with success, SDL_APP_CONTINUE to continue.
351 *
352 * \threadsafety This function may get called concurrently with
353 * SDL_AppIterate() or SDL_AppQuit() for events not pushed from
354 * the main thread.
355 *
356 * \since This function is available since SDL 3.1.3.
357 *
358 * \sa SDL_AppInit
359 * \sa SDL_AppIterate
360 */
361extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, SDL_Event *event);
362
363/**
364 * App-implemented deinit entry point for SDL_MAIN_USE_CALLBACKS apps.
365 *
366 * Apps implement this function when using SDL_MAIN_USE_CALLBACKS. If using a
367 * standard "main" function, you should not supply this.
368 *
369 * This function is called once by SDL before terminating the program.
370 *
371 * This function will be called no matter what, even if SDL_AppInit requests
372 * termination.
373 *
374 * This function should not go into an infinite mainloop; it should
375 * deinitialize any resources necessary, perform whatever shutdown activities,
376 * and return.
377 *
378 * You do not need to call SDL_Quit() in this function, as SDL will call it
379 * after this function returns and before the process terminates, but it is
380 * safe to do so.
381 *
382 * The `appstate` parameter is an optional pointer provided by the app during
383 * SDL_AppInit(). If the app never provided a pointer, this will be NULL. This
384 * function call is the last time this pointer will be provided, so any
385 * resources to it should be cleaned up here.
386 *
387 * This function is called by SDL on the main thread.
388 *
389 * \param appstate an optional pointer, provided by the app in SDL_AppInit.
390 * \param result the result code that terminated the app (success or failure).
391 *
392 * \threadsafety SDL_AppEvent() may get called concurrently with this function
393 * if other threads that push events are still active.
394 *
395 * \since This function is available since SDL 3.1.3.
396 *
397 * \sa SDL_AppInit
398 */
399extern SDLMAIN_DECLSPEC void SDLCALL SDL_AppQuit(void *appstate, SDL_AppResult result);
400
401#endif /* SDL_MAIN_USE_CALLBACKS */
402
403
404/**
405 * The prototype for the application's main() function
406 *
407 * \param argc an ANSI-C style main function's argc.
408 * \param argv an ANSI-C style main function's argv.
409 * \returns an ANSI-C main return code; generally 0 is considered successful
410 * program completion, and small non-zero values are considered
411 * errors.
412 *
413 * \since This datatype is available since SDL 3.1.3.
414 */
415typedef int (SDLCALL *SDL_main_func)(int argc, char *argv[]);
416
417/**
418 * An app-supplied function for program entry.
419 *
420 * Apps do not directly create this function; they should create a standard
421 * ANSI-C `main` function instead. If SDL needs to insert some startup code
422 * before `main` runs, or the platform doesn't actually _use_ a function
423 * called "main", SDL will do some macro magic to redefine `main` to
424 * `SDL_main` and provide its own `main`.
425 *
426 * Apps should include `SDL_main.h` in the same file as their `main` function,
427 * and they should not use that symbol for anything else in that file, as it
428 * might get redefined.
429 *
430 * This function is only provided by the app if it isn't using
431 * SDL_MAIN_USE_CALLBACKS.
432 *
433 * Program startup is a surprisingly complex topic. Please see
434 * [README/main-functions](README/main-functions), (or
435 * docs/README-main-functions.md in the source tree) for a more detailed
436 * explanation.
437 *
438 * \param argc an ANSI-C style main function's argc.
439 * \param argv an ANSI-C style main function's argv.
440 * \returns an ANSI-C main return code; generally 0 is considered successful
441 * program completion, and small non-zero values are considered
442 * errors.
443 *
444 * \threadsafety This is the program entry point.
445 *
446 * \since This function is available since SDL 3.1.3.
447 */
448extern SDLMAIN_DECLSPEC int SDLCALL SDL_main(int argc, char *argv[]);
449
450/**
451 * Circumvent failure of SDL_Init() when not using SDL_main() as an entry
452 * point.
453 *
454 * This function is defined in SDL_main.h, along with the preprocessor rule to
455 * redefine main() as SDL_main(). Thus to ensure that your main() function
456 * will not be changed it is necessary to define SDL_MAIN_HANDLED before
457 * including SDL.h.
458 *
459 * \since This function is available since SDL 3.1.3.
460 *
461 * \sa SDL_Init
462 */
463extern SDL_DECLSPEC void SDLCALL SDL_SetMainReady(void);
464
465/**
466 * Initializes and launches an SDL application, by doing platform-specific
467 * initialization before calling your mainFunction and cleanups after it
468 * returns, if that is needed for a specific platform, otherwise it just calls
469 * mainFunction.
470 *
471 * You can use this if you want to use your own main() implementation without
472 * using SDL_main (like when using SDL_MAIN_HANDLED). When using this, you do
473 * *not* need SDL_SetMainReady().
474 *
475 * \param argc the argc parameter from the application's main() function, or 0
476 * if the platform's main-equivalent has no argc.
477 * \param argv the argv parameter from the application's main() function, or
478 * NULL if the platform's main-equivalent has no argv.
479 * \param mainFunction your SDL app's C-style main(). NOT the function you're
480 * calling this from! Its name doesn't matter; it doesn't
481 * literally have to be `main`.
482 * \param reserved should be NULL (reserved for future use, will probably be
483 * platform-specific then).
484 * \returns the return value from mainFunction: 0 on success, otherwise
485 * failure; SDL_GetError() might have more information on the
486 * failure.
487 *
488 * \threadsafety Generally this is called once, near startup, from the
489 * process's initial thread.
490 *
491 * \since This function is available since SDL 3.1.3.
492 */
493extern SDL_DECLSPEC int SDLCALL SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void *reserved);
494
495/**
496 * An entry point for SDL's use in SDL_MAIN_USE_CALLBACKS.
497 *
498 * Generally, you should not call this function directly. This only exists to
499 * hand off work into SDL as soon as possible, where it has a lot more control
500 * and functionality available, and make the inline code in SDL_main.h as
501 * small as possible.
502 *
503 * Not all platforms use this, it's actual use is hidden in a magic
504 * header-only library, and you should not call this directly unless you
505 * _really_ know what you're doing.
506 *
507 * \param argc standard Unix main argc.
508 * \param argv standard Unix main argv.
509 * \param appinit the application's SDL_AppInit function.
510 * \param appiter the application's SDL_AppIterate function.
511 * \param appevent the application's SDL_AppEvent function.
512 * \param appquit the application's SDL_AppQuit function.
513 * \returns standard Unix main return value.
514 *
515 * \threadsafety It is not safe to call this anywhere except as the only
516 * function call in SDL_main.
517 *
518 * \since This function is available since SDL 3.1.3.
519 */
520extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit);
521
522
523#if defined(SDL_PLATFORM_WINDOWS)
524
525/**
526 * Register a win32 window class for SDL's use.
527 *
528 * This can be called to set the application window class at startup. It is
529 * safe to call this multiple times, as long as every call is eventually
530 * paired with a call to SDL_UnregisterApp, but a second registration attempt
531 * while a previous registration is still active will be ignored, other than
532 * to increment a counter.
533 *
534 * Most applications do not need to, and should not, call this directly; SDL
535 * will call it when initializing the video subsystem.
536 *
537 * \param name the window class name, in UTF-8 encoding. If NULL, SDL
538 * currently uses "SDL_app" but this isn't guaranteed.
539 * \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL
540 * currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of
541 * what is specified here.
542 * \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL
543 * will use `GetModuleHandle(NULL)` instead.
544 * \returns true on success or false on failure; call SDL_GetError() for more
545 * information.
546 *
547 * \since This function is available since SDL 3.1.3.
548 */
549extern SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
550
551/**
552 * Deregister the win32 window class from an SDL_RegisterApp call.
553 *
554 * This can be called to undo the effects of SDL_RegisterApp.
555 *
556 * Most applications do not need to, and should not, call this directly; SDL
557 * will call it when deinitializing the video subsystem.
558 *
559 * It is safe to call this multiple times, as long as every call is eventually
560 * paired with a prior call to SDL_RegisterApp. The window class will only be
561 * deregistered when the registration counter in SDL_RegisterApp decrements to
562 * zero through calls to this function.
563 *
564 * \since This function is available since SDL 3.1.3.
565 */
566extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void);
567
568#endif /* defined(SDL_PLATFORM_WINDOWS) */
569
570#ifdef SDL_PLATFORM_GDK
571
572/**
573 * Callback from the application to let the suspend continue.
574 *
575 * \since This function is available since SDL 3.1.3.
576 */
577extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
578
579#endif /* SDL_PLATFORM_GDK */
580
581#ifdef __cplusplus
582}
583#endif
584
585#include <SDL3/SDL_close_code.h>
586
587#if !defined(SDL_MAIN_HANDLED) && !defined(SDL_MAIN_NOIMPL)
588 /* include header-only SDL_main implementations */
589 #if defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
590 /* platforms which main (-equivalent) can be implemented in plain C */
591 #include <SDL3/SDL_main_impl.h>
592 #endif
593#endif
594
595#endif /* SDL_main_h_ */
SDL_AppResult(* SDL_AppEvent_func)(void *appstate, SDL_Event *event)
Definition SDL_init.h:118
SDL_AppResult(* SDL_AppInit_func)(void **appstate, int argc, char *argv[])
Definition SDL_init.h:116
SDL_AppResult
Definition SDL_init.h:110
void(* SDL_AppQuit_func)(void *appstate, SDL_AppResult result)
Definition SDL_init.h:119
SDL_AppResult(* SDL_AppIterate_func)(void *appstate)
Definition SDL_init.h:117
void SDL_SetMainReady(void)
SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[])
#define SDLMAIN_DECLSPEC
Definition SDL_main.h:153
int(* SDL_main_func)(int argc, char *argv[])
Definition SDL_main.h:415
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void *reserved)
uint32_t Uint32
Definition SDL_stdinc.h:370