diff options
author | MAN-AT-ARMS <donny@ecgnetwork.com> | 2014-03-24 19:13:56 -0400 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2014-08-28 11:03:33 +0100 |
commit | 93128472323d98f9902b280e2716874cfd0b2a05 (patch) | |
tree | a164f935d44b0d1ca10439ef82358392b8847198 /src/SDL2/include/SDL_main.h | |
parent | 691ccef4078f82424e1c3dae2e7d1ba0ff6573ce (diff) |
Update SDL2 to 2.0.3
Diffstat (limited to 'src/SDL2/include/SDL_main.h')
-rw-r--r-- | src/SDL2/include/SDL_main.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/SDL2/include/SDL_main.h b/src/SDL2/include/SDL_main.h index 1f2bad3f..2e8fae95 100644 --- a/src/SDL2/include/SDL_main.h +++ b/src/SDL2/include/SDL_main.h @@ -39,6 +39,18 @@ */ #define SDL_MAIN_AVAILABLE +#elif defined(__WINRT__) +/* On WinRT, SDL provides a main function that initializes CoreApplication, + creating an instance of IFrameworkView in the process. + + Please note that #include'ing SDL_main.h is not enough to get a main() + function working. In non-XAML apps, the file, + src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled + 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(__IPHONEOS__) /* On iOS SDL provides a main function that creates an application delegate and starts the iOS application run loop. @@ -115,6 +127,24 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); #endif /* __WIN32__ */ +#ifdef __WINRT__ + +/** + * \brief Initializes and launches an SDL/WinRT application. + * + * \param mainFunction The SDL app's C-style main(). + * \param xamlBackgroundPanel An optional, XAML-based, background panel. + * For Non-XAML apps, this value must be set to NULL. For XAML apps, + * pass in a pointer to a SwapChainBackgroundPanel, casted to an + * IInspectable (via reinterpret_cast). + * \ret 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more + * information on the failure. + */ +extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * xamlBackgroundPanel); + +#endif /* __WINRT__ */ + + #ifdef __cplusplus } #endif |