include/SDL_system.h
changeset 8582 c3e9a2b93517
parent 8535 e8ee0708ef5c
child 8583 fb2933ca805f
     1.1 --- a/include/SDL_system.h	Tue Mar 04 19:49:11 2014 -0500
     1.2 +++ b/include/SDL_system.h	Sun Mar 09 11:06:11 2014 -0700
     1.3 @@ -1,185 +1,185 @@
     1.4 -/*
     1.5 -  Simple DirectMedia Layer
     1.6 -  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
     1.7 -
     1.8 -  This software is provided 'as-is', without any express or implied
     1.9 -  warranty.  In no event will the authors be held liable for any damages
    1.10 -  arising from the use of this software.
    1.11 -
    1.12 -  Permission is granted to anyone to use this software for any purpose,
    1.13 -  including commercial applications, and to alter it and redistribute it
    1.14 -  freely, subject to the following restrictions:
    1.15 -
    1.16 -  1. The origin of this software must not be misrepresented; you must not
    1.17 -     claim that you wrote the original software. If you use this software
    1.18 -     in a product, an acknowledgment in the product documentation would be
    1.19 -     appreciated but is not required.
    1.20 -  2. Altered source versions must be plainly marked as such, and must not be
    1.21 -     misrepresented as being the original software.
    1.22 -  3. This notice may not be removed or altered from any source distribution.
    1.23 -*/
    1.24 -
    1.25 -/**
    1.26 - *  \file SDL_system.h
    1.27 - *
    1.28 - *  Include file for platform specific SDL API functions
    1.29 - */
    1.30 -
    1.31 -#ifndef _SDL_system_h
    1.32 -#define _SDL_system_h
    1.33 -
    1.34 -#include "SDL_stdinc.h"
    1.35 -#include "SDL_keyboard.h"
    1.36 -#include "SDL_render.h"
    1.37 -#include "SDL_video.h"
    1.38 -
    1.39 -#include "begin_code.h"
    1.40 -/* Set up for C function definitions, even when using C++ */
    1.41 -#ifdef __cplusplus
    1.42 -extern "C" {
    1.43 -#endif
    1.44 -
    1.45 -
    1.46 -/* Platform specific functions for Windows */
    1.47 -#ifdef __WIN32__
    1.48 -
    1.49 -/* Returns the D3D9 adapter index that matches the specified display index.
    1.50 -   This adapter index can be passed to IDirect3D9::CreateDevice and controls
    1.51 -   on which monitor a full screen application will appear.
    1.52 -*/
    1.53 -extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
    1.54 -
    1.55 -/* Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
    1.56 -   Once you are done using the device, you should release it to avoid a resource leak.
    1.57 - */
    1.58 -typedef struct IDirect3DDevice9 IDirect3DDevice9;
    1.59 -extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
    1.60 -
    1.61 -#endif /* __WIN32__ */
    1.62 -
    1.63 -
    1.64 -/* Platform specific functions for iOS */
    1.65 -#if defined(__IPHONEOS__) && __IPHONEOS__
    1.66 -
    1.67 -extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
    1.68 -extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
    1.69 -
    1.70 -#endif /* __IPHONEOS__ */
    1.71 -
    1.72 -
    1.73 -/* Platform specific functions for Android */
    1.74 -#if defined(__ANDROID__) && __ANDROID__
    1.75 -
    1.76 -/* Get the JNI environment for the current thread
    1.77 -   This returns JNIEnv*, but the prototype is void* so we don't need jni.h
    1.78 - */
    1.79 -extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
    1.80 -
    1.81 -/* Get the SDL Activity object for the application
    1.82 -   This returns jobject, but the prototype is void* so we don't need jni.h
    1.83 -   The jobject returned by SDL_AndroidGetActivity is a local reference.
    1.84 -   It is the caller's responsibility to properly release it
    1.85 -   (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
    1.86 - */
    1.87 -extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
    1.88 -
    1.89 -/* See the official Android developer guide for more information:
    1.90 -   http://developer.android.com/guide/topics/data/data-storage.html
    1.91 -*/
    1.92 -#define SDL_ANDROID_EXTERNAL_STORAGE_READ   0x01
    1.93 -#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
    1.94 -
    1.95 -/* Get the path used for internal storage for this application.
    1.96 -   This path is unique to your application and cannot be written to
    1.97 -   by other applications.
    1.98 - */
    1.99 -extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
   1.100 -
   1.101 -/* Get the current state of external storage, a bitmask of these values:
   1.102 -    SDL_ANDROID_EXTERNAL_STORAGE_READ
   1.103 -    SDL_ANDROID_EXTERNAL_STORAGE_WRITE
   1.104 -   If external storage is currently unavailable, this will return 0.
   1.105 -*/
   1.106 -extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();
   1.107 -
   1.108 -/* Get the path used for external storage for this application.
   1.109 -   This path is unique to your application, but is public and can be
   1.110 -   written to by other applications.
   1.111 - */
   1.112 -extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();
   1.113 -
   1.114 -#endif /* __ANDROID__ */
   1.115 -
   1.116 -/* Platform specific functions for WinRT */
   1.117 -#if defined(__WINRT__) && __WINRT__
   1.118 -
   1.119 -/**
   1.120 - *  \brief WinRT / Windows Phone path types
   1.121 - */
   1.122 -typedef enum
   1.123 -{
   1.124 -    /** \brief The installed app's root directory.
   1.125 -        Files here are likely to be read-only. */
   1.126 -    SDL_WINRT_PATH_INSTALLED_LOCATION,
   1.127 -
   1.128 -    /** \brief The app's local data store.  Files may be written here */
   1.129 -    SDL_WINRT_PATH_LOCAL_FOLDER,
   1.130 -
   1.131 -    /** \brief The app's roaming data store.  Unsupported on Windows Phone.
   1.132 -        Files written here may be copied to other machines via a network
   1.133 -        connection.
   1.134 -    */
   1.135 -    SDL_WINRT_PATH_ROAMING_FOLDER,
   1.136 -
   1.137 -    /** \brief The app's temporary data store.  Unsupported on Windows Phone.
   1.138 -        Files written here may be deleted at any time. */
   1.139 -    SDL_WINRT_PATH_TEMP_FOLDER
   1.140 -} SDL_WinRT_Path;
   1.141 -
   1.142 -
   1.143 -/**
   1.144 - *  \brief Retrieves a WinRT defined path on the local file system
   1.145 - *
   1.146 - *  \note Documentation on most app-specific path types on WinRT
   1.147 - *      can be found on MSDN, at the URL:
   1.148 - *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
   1.149 - *
   1.150 - *  \param pathType The type of path to retrieve.
   1.151 - *  \ret A UCS-2 string (16-bit, wide-char) containing the path, or NULL
   1.152 - *      if the path is not available for any reason.  Not all paths are
   1.153 - *      available on all versions of Windows.  This is especially true on
   1.154 - *      Windows Phone.  Check the documentation for the given
   1.155 - *      SDL_WinRT_Path for more information on which path types are
   1.156 - *      supported where.
   1.157 - */
   1.158 -extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
   1.159 -
   1.160 -/**
   1.161 - *  \brief Retrieves a WinRT defined path on the local file system
   1.162 - *
   1.163 - *  \note Documentation on most app-specific path types on WinRT
   1.164 - *      can be found on MSDN, at the URL:
   1.165 - *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
   1.166 - *
   1.167 - *  \param pathType The type of path to retrieve.
   1.168 - *  \ret A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
   1.169 - *      if the path is not available for any reason.  Not all paths are
   1.170 - *      available on all versions of Windows.  This is especially true on
   1.171 - *      Windows Phone.  Check the documentation for the given
   1.172 - *      SDL_WinRT_Path for more information on which path types are
   1.173 - *      supported where.
   1.174 - */
   1.175 -extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
   1.176 -
   1.177 -#endif /* __WINRT__ */
   1.178 -
   1.179 -
   1.180 -/* Ends C function definitions when using C++ */
   1.181 -#ifdef __cplusplus
   1.182 -}
   1.183 -#endif
   1.184 -#include "close_code.h"
   1.185 -
   1.186 -#endif /* _SDL_system_h */
   1.187 -
   1.188 -/* vi: set ts=4 sw=4 expandtab: */
   1.189 +/*
   1.190 +  Simple DirectMedia Layer
   1.191 +  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
   1.192 +
   1.193 +  This software is provided 'as-is', without any express or implied
   1.194 +  warranty.  In no event will the authors be held liable for any damages
   1.195 +  arising from the use of this software.
   1.196 +
   1.197 +  Permission is granted to anyone to use this software for any purpose,
   1.198 +  including commercial applications, and to alter it and redistribute it
   1.199 +  freely, subject to the following restrictions:
   1.200 +
   1.201 +  1. The origin of this software must not be misrepresented; you must not
   1.202 +     claim that you wrote the original software. If you use this software
   1.203 +     in a product, an acknowledgment in the product documentation would be
   1.204 +     appreciated but is not required.
   1.205 +  2. Altered source versions must be plainly marked as such, and must not be
   1.206 +     misrepresented as being the original software.
   1.207 +  3. This notice may not be removed or altered from any source distribution.
   1.208 +*/
   1.209 +
   1.210 +/**
   1.211 + *  \file SDL_system.h
   1.212 + *
   1.213 + *  Include file for platform specific SDL API functions
   1.214 + */
   1.215 +
   1.216 +#ifndef _SDL_system_h
   1.217 +#define _SDL_system_h
   1.218 +
   1.219 +#include "SDL_stdinc.h"
   1.220 +#include "SDL_keyboard.h"
   1.221 +#include "SDL_render.h"
   1.222 +#include "SDL_video.h"
   1.223 +
   1.224 +#include "begin_code.h"
   1.225 +/* Set up for C function definitions, even when using C++ */
   1.226 +#ifdef __cplusplus
   1.227 +extern "C" {
   1.228 +#endif
   1.229 +
   1.230 +
   1.231 +/* Platform specific functions for Windows */
   1.232 +#ifdef __WIN32__
   1.233 +
   1.234 +/* Returns the D3D9 adapter index that matches the specified display index.
   1.235 +   This adapter index can be passed to IDirect3D9::CreateDevice and controls
   1.236 +   on which monitor a full screen application will appear.
   1.237 +*/
   1.238 +extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
   1.239 +
   1.240 +/* Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
   1.241 +   Once you are done using the device, you should release it to avoid a resource leak.
   1.242 + */
   1.243 +typedef struct IDirect3DDevice9 IDirect3DDevice9;
   1.244 +extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
   1.245 +
   1.246 +#endif /* __WIN32__ */
   1.247 +
   1.248 +
   1.249 +/* Platform specific functions for iOS */
   1.250 +#if defined(__IPHONEOS__) && __IPHONEOS__
   1.251 +
   1.252 +extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
   1.253 +extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
   1.254 +
   1.255 +#endif /* __IPHONEOS__ */
   1.256 +
   1.257 +
   1.258 +/* Platform specific functions for Android */
   1.259 +#if defined(__ANDROID__) && __ANDROID__
   1.260 +
   1.261 +/* Get the JNI environment for the current thread
   1.262 +   This returns JNIEnv*, but the prototype is void* so we don't need jni.h
   1.263 + */
   1.264 +extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
   1.265 +
   1.266 +/* Get the SDL Activity object for the application
   1.267 +   This returns jobject, but the prototype is void* so we don't need jni.h
   1.268 +   The jobject returned by SDL_AndroidGetActivity is a local reference.
   1.269 +   It is the caller's responsibility to properly release it
   1.270 +   (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
   1.271 + */
   1.272 +extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
   1.273 +
   1.274 +/* See the official Android developer guide for more information:
   1.275 +   http://developer.android.com/guide/topics/data/data-storage.html
   1.276 +*/
   1.277 +#define SDL_ANDROID_EXTERNAL_STORAGE_READ   0x01
   1.278 +#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
   1.279 +
   1.280 +/* Get the path used for internal storage for this application.
   1.281 +   This path is unique to your application and cannot be written to
   1.282 +   by other applications.
   1.283 + */
   1.284 +extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
   1.285 +
   1.286 +/* Get the current state of external storage, a bitmask of these values:
   1.287 +    SDL_ANDROID_EXTERNAL_STORAGE_READ
   1.288 +    SDL_ANDROID_EXTERNAL_STORAGE_WRITE
   1.289 +   If external storage is currently unavailable, this will return 0.
   1.290 +*/
   1.291 +extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();
   1.292 +
   1.293 +/* Get the path used for external storage for this application.
   1.294 +   This path is unique to your application, but is public and can be
   1.295 +   written to by other applications.
   1.296 + */
   1.297 +extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();
   1.298 +
   1.299 +#endif /* __ANDROID__ */
   1.300 +
   1.301 +/* Platform specific functions for WinRT */
   1.302 +#if defined(__WINRT__) && __WINRT__
   1.303 +
   1.304 +/**
   1.305 + *  \brief WinRT / Windows Phone path types
   1.306 + */
   1.307 +typedef enum
   1.308 +{
   1.309 +    /** \brief The installed app's root directory.
   1.310 +        Files here are likely to be read-only. */
   1.311 +    SDL_WINRT_PATH_INSTALLED_LOCATION,
   1.312 +
   1.313 +    /** \brief The app's local data store.  Files may be written here */
   1.314 +    SDL_WINRT_PATH_LOCAL_FOLDER,
   1.315 +
   1.316 +    /** \brief The app's roaming data store.  Unsupported on Windows Phone.
   1.317 +        Files written here may be copied to other machines via a network
   1.318 +        connection.
   1.319 +    */
   1.320 +    SDL_WINRT_PATH_ROAMING_FOLDER,
   1.321 +
   1.322 +    /** \brief The app's temporary data store.  Unsupported on Windows Phone.
   1.323 +        Files written here may be deleted at any time. */
   1.324 +    SDL_WINRT_PATH_TEMP_FOLDER
   1.325 +} SDL_WinRT_Path;
   1.326 +
   1.327 +
   1.328 +/**
   1.329 + *  \brief Retrieves a WinRT defined path on the local file system
   1.330 + *
   1.331 + *  \note Documentation on most app-specific path types on WinRT
   1.332 + *      can be found on MSDN, at the URL:
   1.333 + *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
   1.334 + *
   1.335 + *  \param pathType The type of path to retrieve.
   1.336 + *  \ret A UCS-2 string (16-bit, wide-char) containing the path, or NULL
   1.337 + *      if the path is not available for any reason.  Not all paths are
   1.338 + *      available on all versions of Windows.  This is especially true on
   1.339 + *      Windows Phone.  Check the documentation for the given
   1.340 + *      SDL_WinRT_Path for more information on which path types are
   1.341 + *      supported where.
   1.342 + */
   1.343 +extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
   1.344 +
   1.345 +/**
   1.346 + *  \brief Retrieves a WinRT defined path on the local file system
   1.347 + *
   1.348 + *  \note Documentation on most app-specific path types on WinRT
   1.349 + *      can be found on MSDN, at the URL:
   1.350 + *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
   1.351 + *
   1.352 + *  \param pathType The type of path to retrieve.
   1.353 + *  \ret A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
   1.354 + *      if the path is not available for any reason.  Not all paths are
   1.355 + *      available on all versions of Windows.  This is especially true on
   1.356 + *      Windows Phone.  Check the documentation for the given
   1.357 + *      SDL_WinRT_Path for more information on which path types are
   1.358 + *      supported where.
   1.359 + */
   1.360 +extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
   1.361 +
   1.362 +#endif /* __WINRT__ */
   1.363 +
   1.364 +
   1.365 +/* Ends C function definitions when using C++ */
   1.366 +#ifdef __cplusplus
   1.367 +}
   1.368 +#endif
   1.369 +#include "close_code.h"
   1.370 +
   1.371 +#endif /* _SDL_system_h */
   1.372 +
   1.373 +/* vi: set ts=4 sw=4 expandtab: */