Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 8 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | Simple DirectMedia Layer |
2 | Simple DirectMedia Layer |
3 | Copyright (C) 1997- |
3 | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
4 | 4 | ||
5 | This software is provided 'as-is', without any express or implied |
5 | This software is provided 'as-is', without any express or implied |
6 | warranty. In no event will the authors be held liable for any damages |
6 | warranty. In no event will the authors be held liable for any damages |
7 | arising from the use of this software. |
7 | arising from the use of this software. |
8 | 8 | ||
Line 74... | Line 74... | ||
74 | extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); |
74 | extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); |
75 | 75 | ||
76 | #endif /* __WIN32__ */ |
76 | #endif /* __WIN32__ */ |
77 | 77 | ||
78 | 78 | ||
- | 79 | /* Platform specific functions for Linux */ |
|
- | 80 | #ifdef __LINUX__ |
|
- | 81 | ||
- | 82 | /** |
|
- | 83 | \brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available. |
|
- | 84 | ||
- | 85 | \return 0 on success, or -1 on error. |
|
- | 86 | */ |
|
- | 87 | extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority); |
|
- | 88 | ||
- | 89 | #endif /* __LINUX__ */ |
|
- | 90 | ||
79 | /* Platform specific functions for iOS */ |
91 | /* Platform specific functions for iOS */ |
80 | #if defined(__IPHONEOS__) && __IPHONEOS__ |
92 | #if defined(__IPHONEOS__) && __IPHONEOS__ |
81 | 93 | ||
82 | #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) |
94 | #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) |
83 | extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); |
95 | extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); |
84 | 96 | ||
85 | #define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) |
97 | #define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) |
86 | extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); |
98 | extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); |
87 | 99 | ||
88 | #endif /* __IPHONEOS__ */ |
100 | #endif /* __IPHONEOS__ */ |
89 | 101 | ||
90 | 102 | ||
91 | /* Platform specific functions for Android */ |
103 | /* Platform specific functions for Android */ |
92 | #if defined(__ANDROID__) && __ANDROID__ |
104 | #if defined(__ANDROID__) && __ANDROID__ |
93 | 105 | ||
94 | /** |
106 | /** |
95 | \brief Get the JNI environment for the current thread |
107 | \brief Get the JNI environment for the current thread |
96 | 108 | ||
97 | This returns JNIEnv*, but the prototype is void* so we don't need jni.h |
109 | This returns JNIEnv*, but the prototype is void* so we don't need jni.h |
98 | */ |
110 | */ |
99 | extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); |
111 | extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); |
100 | 112 | ||
101 | /** |
113 | /** |
102 | \brief Get the SDL Activity object for the application |
114 | \brief Get the SDL Activity object for the application |
103 | 115 | ||
104 | This returns jobject, but the prototype is void* so we don't need jni.h |
116 | This returns jobject, but the prototype is void* so we don't need jni.h |
105 | The jobject returned by SDL_AndroidGetActivity is a local reference. |
117 | The jobject returned by SDL_AndroidGetActivity is a local reference. |
106 | It is the caller's responsibility to properly release it |
118 | It is the caller's responsibility to properly release it |
107 | (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) |
119 | (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) |
108 | */ |
120 | */ |
109 | extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); |
121 | extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); |
110 | 122 | ||
- | 123 | /** |
|
- | 124 | \brief Return true if the application is running on Android TV |
|
- | 125 | */ |
|
- | 126 | extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void); |
|
- | 127 | ||
- | 128 | /** |
|
- | 129 | \brief Return true if the application is running on a Chromebook |
|
- | 130 | */ |
|
- | 131 | extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void); |
|
- | 132 | ||
- | 133 | /** |
|
- | 134 | \brief Return true is the application is running on a Samsung DeX docking station |
|
- | 135 | */ |
|
- | 136 | extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); |
|
- | 137 | ||
- | 138 | /** |
|
- | 139 | \brief Trigger the Android system back button behavior. |
|
- | 140 | */ |
|
- | 141 | extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void); |
|
- | 142 | ||
111 | /** |
143 | /** |
112 | See the official Android developer guide for more information: |
144 | See the official Android developer guide for more information: |
113 | http://developer.android.com/guide/topics/data/data-storage.html |
145 | http://developer.android.com/guide/topics/data/data-storage.html |
114 | */ |
146 | */ |
115 | #define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 |
147 | #define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 |
Line 120... | Line 152... | ||
120 | 152 | ||
121 | This path is unique to your application and cannot be written to |
153 | This path is unique to your application and cannot be written to |
122 | by other applications. |
154 | by other applications. |
123 | */ |
155 | */ |
124 | extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void); |
156 | extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void); |
125 | 157 | ||
126 | /** |
158 | /** |
127 | \brief Get the current state of external storage, a bitmask of these values: |
159 | \brief Get the current state of external storage, a bitmask of these values: |
128 | SDL_ANDROID_EXTERNAL_STORAGE_READ |
160 | SDL_ANDROID_EXTERNAL_STORAGE_READ |
129 | SDL_ANDROID_EXTERNAL_STORAGE_WRITE |
161 | SDL_ANDROID_EXTERNAL_STORAGE_WRITE |
130 | 162 | ||
131 | If external storage is currently unavailable, this will return 0. |
163 | If external storage is currently unavailable, this will return 0. |
132 | */ |
164 | */ |
133 | extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); |
165 | extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); |
134 | 166 | ||
135 | /** |
167 | /** |
136 | \brief Get the path used for external storage for this application. |
168 | \brief Get the path used for external storage for this application. |
137 | 169 | ||
138 | This path is unique to your application, but is public and can be |
170 | This path is unique to your application, but is public and can be |
139 | written to by other applications. |
171 | written to by other applications. |
140 | */ |
172 | */ |
141 | extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); |
173 | extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); |
142 | 174 | ||
143 | #endif /* __ANDROID__ */ |
175 | #endif /* __ANDROID__ */ |
144 | 176 | ||
145 | /* Platform specific functions for WinRT */ |
177 | /* Platform specific functions for WinRT */ |
146 | #if defined(__WINRT__) && __WINRT__ |
178 | #if defined(__WINRT__) && __WINRT__ |
147 | 179 | ||
Line 165... | Line 197... | ||
165 | 197 | ||
166 | /** \brief The app's temporary data store. Unsupported on Windows Phone. |
198 | /** \brief The app's temporary data store. Unsupported on Windows Phone. |
167 | Files written here may be deleted at any time. */ |
199 | Files written here may be deleted at any time. */ |
168 | SDL_WINRT_PATH_TEMP_FOLDER |
200 | SDL_WINRT_PATH_TEMP_FOLDER |
169 | } SDL_WinRT_Path; |
201 | } SDL_WinRT_Path; |
- | 202 | ||
170 | 203 | ||
- | 204 | /** |
|
- | 205 | * \brief WinRT Device Family |
|
- | 206 | */ |
|
- | 207 | typedef enum |
|
- | 208 | { |
|
- | 209 | /** \brief Unknown family */ |
|
- | 210 | SDL_WINRT_DEVICEFAMILY_UNKNOWN, |
|
- | 211 | ||
- | 212 | /** \brief Desktop family*/ |
|
- | 213 | SDL_WINRT_DEVICEFAMILY_DESKTOP, |
|
- | 214 | ||
- | 215 | /** \brief Mobile family (for example smartphone) */ |
|
- | 216 | SDL_WINRT_DEVICEFAMILY_MOBILE, |
|
- | 217 | ||
- | 218 | /** \brief XBox family */ |
|
- | 219 | SDL_WINRT_DEVICEFAMILY_XBOX, |
|
- | 220 | } SDL_WinRT_DeviceFamily; |
|
- | 221 | ||
171 | 222 | ||
172 | /** |
223 | /** |
173 | * \brief Retrieves a WinRT defined path on the local file system |
224 | * \brief Retrieves a WinRT defined path on the local file system |
174 | * |
225 | * |
175 | * \note Documentation on most app-specific path types on WinRT |
226 | * \note Documentation on most app-specific path types on WinRT |
176 | * can be found on MSDN, at the URL: |
227 | * can be found on MSDN, at the URL: |
177 | * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx |
228 | * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx |
178 | * |
229 | * |
179 | * \param pathType The type of path to retrieve. |
230 | * \param pathType The type of path to retrieve. |
Line 200... | Line 251... | ||
200 | * Windows Phone. Check the documentation for the given |
251 | * Windows Phone. Check the documentation for the given |
201 | * SDL_WinRT_Path for more information on which path types are |
252 | * SDL_WinRT_Path for more information on which path types are |
202 | * supported where. |
253 | * supported where. |
203 | */ |
254 | */ |
204 | extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); |
255 | extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); |
- | 256 | ||
- | 257 | /** |
|
- | 258 | * \brief Detects the device family of WinRT plattform on runtime |
|
- | 259 | * |
|
- | 260 | * \return Device family |
|
- | 261 | */ |
|
- | 262 | extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); |
|
205 | 263 | ||
206 | #endif /* __WINRT__ */ |
264 | #endif /* __WINRT__ */ |
- | 265 | ||
- | 266 | /** |
|
- | 267 | \brief Return true if the current device is a tablet. |
|
- | 268 | */ |
|
- | 269 | extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void); |
|
207 | 270 | ||
208 | /* Ends C function definitions when using C++ */ |
271 | /* Ends C function definitions when using C++ */ |
209 | #ifdef __cplusplus |
272 | #ifdef __cplusplus |
210 | } |
273 | } |
211 | #endif |
274 | #endif |