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