| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | #include "SDL_config_premake.h" |
| | | #elif defined(__WIN32__) |
| | | #include "SDL_config_windows.h" |
| | | #elif defined(__WINRT__) |
| | | #include "SDL_config_winrt.h" |
| | | #elif defined(__MACOSX__) |
| | | #include "SDL_config_macosx.h" |
| | | #elif defined(__IPHONEOS__) |
| | |
| | | |
| | | /* Need to do this here because intrin.h has C++ code in it */ |
| | | /* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ |
| | | #if defined(_MSC_VER) && (_MSC_VER >= 1500) |
| | | #if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) |
| | | #include <intrin.h> |
| | | #ifndef _WIN64 |
| | | #define __MMX__ |
| | |
| | | #define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" |
| | | |
| | | /** |
| | | * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. |
| | | * |
| | | * This variable does not have any effect on the Direct3D 9 based renderer. |
| | | * |
| | | * This variable can be set to the following values: |
| | | * "0" - Disable Debug Layer use |
| | | * "1" - Enable Debug Layer use |
| | | * |
| | | * By default, SDL does not use Direct3D Debug Layer. |
| | | */ |
| | | #define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_HINT_RENDER_DIRECT3D11_DEBUG" |
| | | |
| | | /** |
| | | * \brief A variable controlling the scaling quality |
| | | * |
| | | * This variable can be set to the following values: |
| | |
| | | * If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has |
| | | * SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly |
| | | * created SDL_Window: |
| | | |
| | | * |
| | | * 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is |
| | | * needed for example when sharing an OpenGL context across multiple windows. |
| | | * |
| | |
| | | */ |
| | | #define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" |
| | | |
| | | /* |
| | | * \brief A URL to a WinRT app's privacy policy |
| | | * |
| | | * All network-enabled WinRT apps must make a privacy policy available to its |
| | | * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be |
| | | * be available in the Windows Settings charm, as accessed from within the app. |
| | | * SDL provides code to add a URL-based link there, which can point to the app's |
| | | * privacy policy. |
| | | * |
| | | * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL |
| | | * before calling any SDL_Init functions. The contents of the hint should |
| | | * be a valid URL. For example, "http://www.example.com". |
| | | * |
| | | * The default value is "", which will prevent SDL from adding a privacy policy |
| | | * link to the Settings charm. This hint should only be set during app init. |
| | | * |
| | | * The label text of an app's "Privacy Policy" link may be customized via another |
| | | * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. |
| | | * |
| | | * Please note that on Windows Phone, Microsoft does not provide standard UI |
| | | * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL |
| | | * will not get used on that platform. Network-enabled phone apps should display |
| | | * their privacy policy through some other, in-app means. |
| | | */ |
| | | #define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_HINT_WINRT_PRIVACY_POLICY_URL" |
| | | |
| | | /** \brief Label text for a WinRT app's privacy policy link |
| | | * |
| | | * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, |
| | | * Microsoft mandates that this policy be available via the Windows Settings charm. |
| | | * SDL provides code to add a link there, with it's label text being set via the |
| | | * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. |
| | | * |
| | | * Please note that a privacy policy's contents are not set via this hint. A separate |
| | | * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the |
| | | * policy. |
| | | * |
| | | * The contents of this hint should be encoded as a UTF8 string. |
| | | * |
| | | * The default value is "Privacy Policy". This hint should only be set during app |
| | | * initialization, preferably before any calls to SDL_Init. |
| | | * |
| | | * For additional information on linking to a privacy policy, see the documentation for |
| | | * SDL_HINT_WINRT_PRIVACY_POLICY_URL. |
| | | */ |
| | | #define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_HINT_WINRT_PRIVACY_POLICY_LABEL" |
| | | |
| | | /** \brief If set to 1, back button press events on Windows Phone 8+ will be marked as handled. |
| | | * |
| | | * TODO, WinRT: document SDL_HINT_WINRT_HANDLE_BACK_BUTTON need and use |
| | | * For now, more details on why this is needed can be found at the |
| | | * beginning of the following web page: |
| | | * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx |
| | | */ |
| | | #define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_HINT_WINRT_HANDLE_BACK_BUTTON" |
| | | |
| | | /** |
| | | * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. |
| | | * |
| | |
| | | */ |
| | | #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. |
| | |
| | | #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 |
| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | | arising from the use of this software. |
| | | |
| | | Permission is granted to anyone to use this software for any purpose, |
| | | including commercial applications, and to alter it and redistribute it |
| | | freely, subject to the following restrictions: |
| | | |
| | | 1. The origin of this software must not be misrepresented; you must not |
| | | claim that you wrote the original software. If you use this software |
| | | in a product, an acknowledgment in the product documentation would be |
| | | appreciated but is not required. |
| | | 2. Altered source versions must be plainly marked as such, and must not be |
| | | misrepresented as being the original software. |
| | | 3. This notice may not be removed or altered from any source distribution. |
| | | */ |
| | | |
| | | #ifndef _SDLname_h_ |
| | | #define _SDLname_h_ |
| | |
| | | #define SDL_NAME(X) SDL_##X |
| | | |
| | | #endif /* _SDLname_h_ */ |
| | | |
| | | /* vi: set ts=4 sw=4 expandtab: */ |
| | |
| | | #undef __SOLARIS__ |
| | | #define __SOLARIS__ 1 |
| | | #endif |
| | | |
| | | #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) |
| | | /* Try to find out if we're compiling for WinRT or non-WinRT */ |
| | | /* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */ |
| | | #if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */ |
| | | #include <winapifamily.h> |
| | | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
| | | #undef __WINDOWS__ |
| | | #define __WINDOWS__ 1 |
| | | /* See if we're compiling for WinRT: */ |
| | | #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) |
| | | #undef __WINRT__ |
| | | #define __WINRT__ 1 |
| | | #endif |
| | | #else |
| | | #undef __WINDOWS__ |
| | | #define __WINDOWS__ 1 |
| | | #endif /* _MSC_VER < 1700 */ |
| | | #endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ |
| | | |
| | | #if defined(__WINDOWS__) |
| | | #undef __WIN32__ |
| | | #define __WIN32__ 1 |
| | |
| | | # include <ctype.h> |
| | | #endif |
| | | #ifdef HAVE_MATH_H |
| | | # if defined(__WINRT__) |
| | | /* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on |
| | | WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx |
| | | for more information. |
| | | */ |
| | | # define _USE_MATH_DEFINES |
| | | # endif |
| | | # include <math.h> |
| | | #endif |
| | | #ifdef HAVE_FLOAT_H |
| | | # include <float.h> |
| | | #endif |
| | | #if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) |
| | | # include <iconv.h> |
| | | #endif |
| | |
| | | |
| | | #endif /* __ANDROID__ */ |
| | | |
| | | /* Platform specific functions for WinRT */ |
| | | #if defined(__WINRT__) && __WINRT__ |
| | | |
| | | /** |
| | | * \brief WinRT / Windows Phone path types |
| | | */ |
| | | typedef enum |
| | | { |
| | | /** \brief The installed app's root directory. |
| | | Files here are likely to be read-only. */ |
| | | SDL_WINRT_PATH_INSTALLED_LOCATION, |
| | | |
| | | /** \brief The app's local data store. Files may be written here */ |
| | | SDL_WINRT_PATH_LOCAL_FOLDER, |
| | | |
| | | /** \brief The app's roaming data store. Unsupported on Windows Phone. |
| | | Files written here may be copied to other machines via a network |
| | | connection. |
| | | */ |
| | | SDL_WINRT_PATH_ROAMING_FOLDER, |
| | | |
| | | /** \brief The app's temporary data store. Unsupported on Windows Phone. |
| | | Files written here may be deleted at any time. */ |
| | | SDL_WINRT_PATH_TEMP_FOLDER |
| | | } SDL_WinRT_Path; |
| | | |
| | | |
| | | /** |
| | | * \brief Retrieves a WinRT defined path on the local file system |
| | | * |
| | | * \note Documentation on most app-specific path types on WinRT |
| | | * can be found on MSDN, at the URL: |
| | | * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx |
| | | * |
| | | * \param pathType The type of path to retrieve. |
| | | * \ret A UCS-2 string (16-bit, wide-char) containing the path, or NULL |
| | | * if the path is not available for any reason. Not all paths are |
| | | * available on all versions of Windows. This is especially true on |
| | | * Windows Phone. Check the documentation for the given |
| | | * SDL_WinRT_Path for more information on which path types are |
| | | * supported where. |
| | | */ |
| | | extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType); |
| | | |
| | | /** |
| | | * \brief Retrieves a WinRT defined path on the local file system |
| | | * |
| | | * \note Documentation on most app-specific path types on WinRT |
| | | * can be found on MSDN, at the URL: |
| | | * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx |
| | | * |
| | | * \param pathType The type of path to retrieve. |
| | | * \ret A UTF-8 string (8-bit, multi-byte) containing the path, or NULL |
| | | * if the path is not available for any reason. Not all paths are |
| | | * available on all versions of Windows. This is especially true on |
| | | * Windows Phone. Check the documentation for the given |
| | | * SDL_WinRT_Path for more information on which path types are |
| | | * supported where. |
| | | */ |
| | | extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); |
| | | |
| | | #endif /* __WINRT__ */ |
| | | |
| | | |
| | | /* Ends C function definitions when using C++ */ |
| | | #ifdef __cplusplus |
| | | } |
| | |
| | | #include <windows.h> |
| | | #endif |
| | | |
| | | #if defined(SDL_VIDEO_DRIVER_WINRT) |
| | | #include <Inspectable.h> |
| | | #endif |
| | | |
| | | /* This is the structure for custom window manager events */ |
| | | #if defined(SDL_VIDEO_DRIVER_X11) |
| | | #if defined(__APPLE__) && defined(__MACH__) |
| | |
| | | #include <UIKit/UIKit.h> |
| | | #else |
| | | typedef struct _UIWindow UIWindow; |
| | | typedef struct _UIViewController UIViewController; |
| | | #endif |
| | | #endif |
| | | |
| | |
| | | SDL_SYSWM_UIKIT, |
| | | SDL_SYSWM_WAYLAND, |
| | | SDL_SYSWM_MIR, |
| | | SDL_SYSWM_WINRT, |
| | | } SDL_SYSWM_TYPE; |
| | | |
| | | /** |
| | |
| | | HWND window; /**< The window handle */ |
| | | } win; |
| | | #endif |
| | | #if defined(SDL_VIDEO_DRIVER_WINRT) |
| | | struct |
| | | { |
| | | IInspectable * window; /**< The WinRT CoreWindow */ |
| | | } winrt; |
| | | #endif |
| | | #if defined(SDL_VIDEO_DRIVER_X11) |
| | | struct |
| | | { |
| | |
| | | */ |
| | | #define SDL_MAJOR_VERSION 2 |
| | | #define SDL_MINOR_VERSION 0 |
| | | #define SDL_PATCHLEVEL 2 |
| | | #define SDL_PATCHLEVEL 3 |
| | | |
| | | /** |
| | | * \brief Macro to determine SDL version program was compiled against. |
| | |
| | | |
| | | /* Some compilers use a special export keyword */ |
| | | #ifndef DECLSPEC |
| | | # if defined(__WIN32__) |
| | | # if defined(__WIN32__) || defined(__WINRT__) |
| | | # ifdef __BORLANDC__ |
| | | # ifdef BUILD_SDL |
| | | # define DECLSPEC |
| | |
| | | |
| | | /* By default SDL uses the C calling convention */ |
| | | #ifndef SDLCALL |
| | | #if defined(__WIN32__) && !defined(__GNUC__) |
| | | #if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) |
| | | #define SDLCALL __cdecl |
| | | #else |
| | | #define SDLCALL |
| | |
| | | #include "SDL_config_premake.h" |
| | | #elif defined(__WIN32__) |
| | | #include "SDL_config_windows.h" |
| | | #elif defined(__WINRT__) |
| | | #include "SDL_config_winrt.h" |
| | | #elif defined(__MACOSX__) |
| | | #include "SDL_config_macosx.h" |
| | | #elif defined(__IPHONEOS__) |
| | |
| | | |
| | | /* Need to do this here because intrin.h has C++ code in it */ |
| | | /* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ |
| | | #if defined(_MSC_VER) && (_MSC_VER >= 1500) |
| | | #if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) |
| | | #include <intrin.h> |
| | | #ifndef _WIN64 |
| | | #define __MMX__ |
| | |
| | | #define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" |
| | | |
| | | /** |
| | | * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. |
| | | * |
| | | * This variable does not have any effect on the Direct3D 9 based renderer. |
| | | * |
| | | * This variable can be set to the following values: |
| | | * "0" - Disable Debug Layer use |
| | | * "1" - Enable Debug Layer use |
| | | * |
| | | * By default, SDL does not use Direct3D Debug Layer. |
| | | */ |
| | | #define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_HINT_RENDER_DIRECT3D11_DEBUG" |
| | | |
| | | /** |
| | | * \brief A variable controlling the scaling quality |
| | | * |
| | | * This variable can be set to the following values: |
| | |
| | | * If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has |
| | | * SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly |
| | | * created SDL_Window: |
| | | |
| | | * |
| | | * 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is |
| | | * needed for example when sharing an OpenGL context across multiple windows. |
| | | * |
| | |
| | | */ |
| | | #define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" |
| | | |
| | | /* |
| | | * \brief A URL to a WinRT app's privacy policy |
| | | * |
| | | * All network-enabled WinRT apps must make a privacy policy available to its |
| | | * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be |
| | | * be available in the Windows Settings charm, as accessed from within the app. |
| | | * SDL provides code to add a URL-based link there, which can point to the app's |
| | | * privacy policy. |
| | | * |
| | | * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL |
| | | * before calling any SDL_Init functions. The contents of the hint should |
| | | * be a valid URL. For example, "http://www.example.com". |
| | | * |
| | | * The default value is "", which will prevent SDL from adding a privacy policy |
| | | * link to the Settings charm. This hint should only be set during app init. |
| | | * |
| | | * The label text of an app's "Privacy Policy" link may be customized via another |
| | | * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. |
| | | * |
| | | * Please note that on Windows Phone, Microsoft does not provide standard UI |
| | | * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL |
| | | * will not get used on that platform. Network-enabled phone apps should display |
| | | * their privacy policy through some other, in-app means. |
| | | */ |
| | | #define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_HINT_WINRT_PRIVACY_POLICY_URL" |
| | | |
| | | /** \brief Label text for a WinRT app's privacy policy link |
| | | * |
| | | * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, |
| | | * Microsoft mandates that this policy be available via the Windows Settings charm. |
| | | * SDL provides code to add a link there, with it's label text being set via the |
| | | * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. |
| | | * |
| | | * Please note that a privacy policy's contents are not set via this hint. A separate |
| | | * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the |
| | | * policy. |
| | | * |
| | | * The contents of this hint should be encoded as a UTF8 string. |
| | | * |
| | | * The default value is "Privacy Policy". This hint should only be set during app |
| | | * initialization, preferably before any calls to SDL_Init. |
| | | * |
| | | * For additional information on linking to a privacy policy, see the documentation for |
| | | * SDL_HINT_WINRT_PRIVACY_POLICY_URL. |
| | | */ |
| | | #define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_HINT_WINRT_PRIVACY_POLICY_LABEL" |
| | | |
| | | /** \brief If set to 1, back button press events on Windows Phone 8+ will be marked as handled. |
| | | * |
| | | * TODO, WinRT: document SDL_HINT_WINRT_HANDLE_BACK_BUTTON need and use |
| | | * For now, more details on why this is needed can be found at the |
| | | * beginning of the following web page: |
| | | * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx |
| | | */ |
| | | #define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_HINT_WINRT_HANDLE_BACK_BUTTON" |
| | | |
| | | /** |
| | | * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. |
| | | * |
| | |
| | | */ |
| | | #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. |
| | |
| | | #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 |
| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | | arising from the use of this software. |
| | | |
| | | Permission is granted to anyone to use this software for any purpose, |
| | | including commercial applications, and to alter it and redistribute it |
| | | freely, subject to the following restrictions: |
| | | |
| | | 1. The origin of this software must not be misrepresented; you must not |
| | | claim that you wrote the original software. If you use this software |
| | | in a product, an acknowledgment in the product documentation would be |
| | | appreciated but is not required. |
| | | 2. Altered source versions must be plainly marked as such, and must not be |
| | | misrepresented as being the original software. |
| | | 3. This notice may not be removed or altered from any source distribution. |
| | | */ |
| | | |
| | | #ifndef _SDLname_h_ |
| | | #define _SDLname_h_ |
| | |
| | | #define SDL_NAME(X) SDL_##X |
| | | |
| | | #endif /* _SDLname_h_ */ |
| | | |
| | | /* vi: set ts=4 sw=4 expandtab: */ |
| | |
| | | #undef __SOLARIS__ |
| | | #define __SOLARIS__ 1 |
| | | #endif |
| | | |
| | | #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) |
| | | /* Try to find out if we're compiling for WinRT or non-WinRT */ |
| | | /* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */ |
| | | #if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */ |
| | | #include <winapifamily.h> |
| | | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
| | | #undef __WINDOWS__ |
| | | #define __WINDOWS__ 1 |
| | | /* See if we're compiling for WinRT: */ |
| | | #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) |
| | | #undef __WINRT__ |
| | | #define __WINRT__ 1 |
| | | #endif |
| | | #else |
| | | #undef __WINDOWS__ |
| | | #define __WINDOWS__ 1 |
| | | #endif /* _MSC_VER < 1700 */ |
| | | #endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ |
| | | |
| | | #if defined(__WINDOWS__) |
| | | #undef __WIN32__ |
| | | #define __WIN32__ 1 |
| | |
| | | # include <ctype.h> |
| | | #endif |
| | | #ifdef HAVE_MATH_H |
| | | # if defined(__WINRT__) |
| | | /* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on |
| | | WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx |
| | | for more information. |
| | | */ |
| | | # define _USE_MATH_DEFINES |
| | | # endif |
| | | # include <math.h> |
| | | #endif |
| | | #ifdef HAVE_FLOAT_H |
| | | # include <float.h> |
| | | #endif |
| | | #if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) |
| | | # include <iconv.h> |
| | | #endif |
| | |
| | | |
| | | #endif /* __ANDROID__ */ |
| | | |
| | | /* Platform specific functions for WinRT */ |
| | | #if defined(__WINRT__) && __WINRT__ |
| | | |
| | | /** |
| | | * \brief WinRT / Windows Phone path types |
| | | */ |
| | | typedef enum |
| | | { |
| | | /** \brief The installed app's root directory. |
| | | Files here are likely to be read-only. */ |
| | | SDL_WINRT_PATH_INSTALLED_LOCATION, |
| | | |
| | | /** \brief The app's local data store. Files may be written here */ |
| | | SDL_WINRT_PATH_LOCAL_FOLDER, |
| | | |
| | | /** \brief The app's roaming data store. Unsupported on Windows Phone. |
| | | Files written here may be copied to other machines via a network |
| | | connection. |
| | | */ |
| | | SDL_WINRT_PATH_ROAMING_FOLDER, |
| | | |
| | | /** \brief The app's temporary data store. Unsupported on Windows Phone. |
| | | Files written here may be deleted at any time. */ |
| | | SDL_WINRT_PATH_TEMP_FOLDER |
| | | } SDL_WinRT_Path; |
| | | |
| | | |
| | | /** |
| | | * \brief Retrieves a WinRT defined path on the local file system |
| | | * |
| | | * \note Documentation on most app-specific path types on WinRT |
| | | * can be found on MSDN, at the URL: |
| | | * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx |
| | | * |
| | | * \param pathType The type of path to retrieve. |
| | | * \ret A UCS-2 string (16-bit, wide-char) containing the path, or NULL |
| | | * if the path is not available for any reason. Not all paths are |
| | | * available on all versions of Windows. This is especially true on |
| | | * Windows Phone. Check the documentation for the given |
| | | * SDL_WinRT_Path for more information on which path types are |
| | | * supported where. |
| | | */ |
| | | extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType); |
| | | |
| | | /** |
| | | * \brief Retrieves a WinRT defined path on the local file system |
| | | * |
| | | * \note Documentation on most app-specific path types on WinRT |
| | | * can be found on MSDN, at the URL: |
| | | * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx |
| | | * |
| | | * \param pathType The type of path to retrieve. |
| | | * \ret A UTF-8 string (8-bit, multi-byte) containing the path, or NULL |
| | | * if the path is not available for any reason. Not all paths are |
| | | * available on all versions of Windows. This is especially true on |
| | | * Windows Phone. Check the documentation for the given |
| | | * SDL_WinRT_Path for more information on which path types are |
| | | * supported where. |
| | | */ |
| | | extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); |
| | | |
| | | #endif /* __WINRT__ */ |
| | | |
| | | |
| | | /* Ends C function definitions when using C++ */ |
| | | #ifdef __cplusplus |
| | | } |
| | |
| | | #include <windows.h> |
| | | #endif |
| | | |
| | | #if defined(SDL_VIDEO_DRIVER_WINRT) |
| | | #include <Inspectable.h> |
| | | #endif |
| | | |
| | | /* This is the structure for custom window manager events */ |
| | | #if defined(SDL_VIDEO_DRIVER_X11) |
| | | #if defined(__APPLE__) && defined(__MACH__) |
| | |
| | | #include <UIKit/UIKit.h> |
| | | #else |
| | | typedef struct _UIWindow UIWindow; |
| | | typedef struct _UIViewController UIViewController; |
| | | #endif |
| | | #endif |
| | | |
| | |
| | | SDL_SYSWM_UIKIT, |
| | | SDL_SYSWM_WAYLAND, |
| | | SDL_SYSWM_MIR, |
| | | SDL_SYSWM_WINRT, |
| | | } SDL_SYSWM_TYPE; |
| | | |
| | | /** |
| | |
| | | HWND window; /**< The window handle */ |
| | | } win; |
| | | #endif |
| | | #if defined(SDL_VIDEO_DRIVER_WINRT) |
| | | struct |
| | | { |
| | | IInspectable * window; /**< The WinRT CoreWindow */ |
| | | } winrt; |
| | | #endif |
| | | #if defined(SDL_VIDEO_DRIVER_X11) |
| | | struct |
| | | { |
| | |
| | | */ |
| | | #define SDL_MAJOR_VERSION 2 |
| | | #define SDL_MINOR_VERSION 0 |
| | | #define SDL_PATCHLEVEL 2 |
| | | #define SDL_PATCHLEVEL 3 |
| | | |
| | | /** |
| | | * \brief Macro to determine SDL version program was compiled against. |
| | |
| | | |
| | | /* Some compilers use a special export keyword */ |
| | | #ifndef DECLSPEC |
| | | # if defined(__WIN32__) |
| | | # if defined(__WIN32__) || defined(__WINRT__) |
| | | # ifdef __BORLANDC__ |
| | | # ifdef BUILD_SDL |
| | | # define DECLSPEC |
| | |
| | | |
| | | /* By default SDL uses the C calling convention */ |
| | | #ifndef SDLCALL |
| | | #if defined(__WIN32__) && !defined(__GNUC__) |
| | | #if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) |
| | | #define SDLCALL __cdecl |
| | | #else |
| | | #define SDLCALL |
| | |
| | | <key>CFBundlePackageType</key> |
| | | <string>FMWK</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>2.0.2</string> |
| | | <string>2.0.3</string> |
| | | <key>CFBundleSignature</key> |
| | | <string>SDLX</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>2.0.2</string> |
| | | <string>2.0.3</string> |
| | | <key>DTCompiler</key> |
| | | <string>com.apple.compilers.llvm.clang.1_0</string> |
| | | <key>DTPlatformBuild</key> |