include/SDL_main.h
changeset 8531 d481485a1b85
parent 8517 d7d86c917b1d
child 8535 e8ee0708ef5c
     1.1 --- a/include/SDL_main.h	Mon Sep 16 22:43:12 2013 -0400
     1.2 +++ b/include/SDL_main.h	Sun Sep 22 12:26:53 2013 -0400
     1.3 @@ -44,8 +44,10 @@
     1.4     creating an instance of IFrameworkView in the process.
     1.5  
     1.6     Please note that #include'ing SDL_main.h is not enough to get a main()
     1.7 -   function working.  The file, src/main/winrt/SDL_WinRT_main.cpp, or a copy
     1.8 -   of it, must be compiled into the app itself.
     1.9 +   function working.  In non-XAML apps, the file,
    1.10 +   src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled
    1.11 +   into the app itself.  In XAML apps, the function, SDL_WinRTRunApp must be
    1.12 +   called, with a pointer to the Direct3D-hosted XAML control passed in.
    1.13  */
    1.14  #define SDL_MAIN_NEEDED
    1.15  
    1.16 @@ -125,6 +127,24 @@
    1.17  #endif /* __WIN32__ */
    1.18  
    1.19  
    1.20 +#ifdef __WINRT__
    1.21 +
    1.22 +/**
    1.23 + *  \brief Initializes and launches an SDL/WinRT application.
    1.24 + *
    1.25 + *  \param mainFunction The SDL app's C-style main().
    1.26 + *  \param xamlBackgroundPanel An optional, XAML-based, background panel.
    1.27 + *     For Non-XAML apps, this value must be set to NULL.  For XAML apps,
    1.28 + *     pass in a pointer to a SwapChainBackgroundPanel, casted to an
    1.29 + *     IInspectable (via reinterpret_cast).
    1.30 + *  \ret 0 on success, -1 on failure.  On failure, use SDL_GetError to retrieve more
    1.31 + *      information on the failure.
    1.32 + */
    1.33 +extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * xamlBackgroundPanel);
    1.34 +
    1.35 +#endif /* __WINRT__ */
    1.36 +
    1.37 +
    1.38  #ifdef __cplusplus
    1.39  }
    1.40  #endif