assets/include/SDL2/SDL_main.h in ruby2d-0.11.3 vs assets/include/SDL2/SDL_main.h in ruby2d-0.12.0

- old
+ new

@@ -49,10 +49,19 @@ into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be called, with a pointer to the Direct3D-hosted XAML control passed in. */ #define SDL_MAIN_NEEDED +#elif defined(__GDK__) +/* On GDK, SDL provides a main function that initializes the game runtime. + + Please note that #include'ing SDL_main.h is not enough to get a main() + function working. You must either link against SDL2main or, if not possible, + call the SDL_GDKRunApp function from your entry point. +*/ +#define SDL_MAIN_NEEDED + #elif defined(__IPHONEOS__) /* On iOS SDL provides a main function that creates an application delegate and starts the iOS application run loop. If you link with SDL dynamically on iOS, the main function can't be in a @@ -90,10 +99,26 @@ If you provide this yourself, you may define SDL_MAIN_HANDLED */ #define SDL_MAIN_AVAILABLE +#elif defined(__PS2__) +#define SDL_MAIN_AVAILABLE + +#define SDL_PS2_SKIP_IOP_RESET() \ + void reset_IOP(); \ + void reset_IOP() {} + +#elif defined(__3DS__) +/* + On N3DS, SDL provides a main function that sets up the screens + and storage. + + If you provide this yourself, you may define SDL_MAIN_HANDLED +*/ +#define SDL_MAIN_AVAILABLE + #endif #endif /* SDL_MAIN_HANDLED */ #ifndef SDLMAIN_DECLSPEC #define SDLMAIN_DECLSPEC @@ -143,11 +168,11 @@ * * \sa SDL_Init */ extern DECLSPEC void SDLCALL SDL_SetMainReady(void); -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__GDK__) /** * Register a win32 window class for SDL's use. * * This can be called to set the application window class at startup. It is @@ -187,11 +212,11 @@ * * \since This function is available since SDL 2.0.2. */ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); -#endif /* __WIN32__ */ +#endif /* defined(__WIN32__) || defined(__GDK__) */ #ifdef __WINRT__ /** @@ -222,9 +247,24 @@ */ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); #endif /* __IPHONEOS__ */ +#ifdef __GDK__ + +/** + * Initialize and launch an SDL GDK application. + * + * \param mainFunction the SDL app's C-style main(), an SDL_main_func + * \param reserved reserved for future use; should be NULL + * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve + * more information on the failure. + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved); + +#endif /* __GDK__ */ #ifdef __cplusplus } #endif #include "close_code.h"