My Project
SDL_system.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4 
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
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
28 #ifndef SDL_system_h_
29 #define SDL_system_h_
30 
31 #include "SDL_stdinc.h"
32 #include "SDL_keyboard.h"
33 #include "SDL_render.h"
34 #include "SDL_video.h"
35 
36 #include "begin_code.h"
37 /* Set up for C function definitions, even when using C++ */
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 
43 /* Platform specific functions for Windows */
44 #ifdef __WIN32__
45 
49 typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
50 extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
51 
58 extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
59 
60 typedef struct IDirect3DDevice9 IDirect3DDevice9;
66 extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
67 
74 extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
75 
76 #endif /* __WIN32__ */
77 
78 
79 /* Platform specific functions for Linux */
80 #ifdef __LINUX__
81 
87 extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
88 
89 #endif /* __LINUX__ */
90 
91 /* Platform specific functions for iOS */
92 #ifdef __IPHONEOS__
93 
94 #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
95 extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
96 
97 #define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
98 extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
99 
100 #endif /* __IPHONEOS__ */
101 
102 
103 /* Platform specific functions for Android */
104 #ifdef __ANDROID__
105 
111 extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
112 
121 extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
122 
148 extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
149 
153 extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
154 
158 extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
159 
163 extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
164 
168 extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
169 
174 #define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
175 #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
176 
183 extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
184 
192 extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
193 
200 extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
201 
208 extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
209 
210 #endif /* __ANDROID__ */
211 
212 /* Platform specific functions for WinRT */
213 #ifdef __WINRT__
214 
218 typedef enum
219 {
222  SDL_WINRT_PATH_INSTALLED_LOCATION,
223 
225  SDL_WINRT_PATH_LOCAL_FOLDER,
226 
231  SDL_WINRT_PATH_ROAMING_FOLDER,
232 
235  SDL_WINRT_PATH_TEMP_FOLDER
236 } SDL_WinRT_Path;
237 
238 
242 typedef enum
243 {
245  SDL_WINRT_DEVICEFAMILY_UNKNOWN,
246 
248  SDL_WINRT_DEVICEFAMILY_DESKTOP,
249 
251  SDL_WINRT_DEVICEFAMILY_MOBILE,
252 
254  SDL_WINRT_DEVICEFAMILY_XBOX,
255 } SDL_WinRT_DeviceFamily;
256 
257 
273 extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
274 
290 extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
291 
297 extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
298 
299 #endif /* __WINRT__ */
300 
304 extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
305 
306 /* Functions used by iOS application delegates to notify SDL about state changes */
307 extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
308 extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
309 extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
310 extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
311 extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
312 extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
313 #ifdef __IPHONEOS__
314 extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
315 #endif
316 
317 /* Ends C function definitions when using C++ */
318 #ifdef __cplusplus
319 }
320 #endif
321 #include "close_code.h"
322 
323 #endif /* SDL_system_h_ */
324 
325 /* vi: set ts=4 sw=4 expandtab: */
SDL_render.h
SDL_stdinc.h
close_code.h
begin_code.h
SDL_video.h
SDL_Surface::userdata
void * userdata
Definition: SDL_surface.h:79
SDL_Window
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:90
SDL_IsTablet
DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void)
Return true if the current device is a tablet.
SDL_keyboard.h