My Project
Loading...
Searching...
No Matches
SDL_system.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2023 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
39extern "C" {
40#endif
41
42
43/* Platform specific functions for Windows */
44#if defined(__WIN32__) || defined(__GDK__)
45
46typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
47
56extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
57
58#endif /* defined(__WIN32__) || defined(__GDK__) */
59
60#if defined(__WIN32__) || defined(__WINGDK__)
61
75extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
76
77typedef struct IDirect3DDevice9 IDirect3DDevice9;
78
91extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
92
93typedef struct ID3D11Device ID3D11Device;
94
107extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
108
109#endif /* defined(__WIN32__) || defined(__WINGDK__) */
110
111#if defined(__WIN32__) || defined(__GDK__)
112
113typedef struct ID3D12Device ID3D12Device;
114
127extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* renderer);
128
129#endif /* defined(__WIN32__) || defined(__GDK__) */
130
131#if defined(__WIN32__) || defined(__WINGDK__)
132
151extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
152
153#endif /* defined(__WIN32__) || defined(__WINGDK__) */
154
155/* Platform specific functions for Linux */
156#ifdef __LINUX__
157
169extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
170
184extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
185
186#endif /* __LINUX__ */
187
188/* Platform specific functions for iOS */
189#ifdef __IPHONEOS__
190
191#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
192
225extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam);
226
227#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
228
243extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
244
245#endif /* __IPHONEOS__ */
246
247
248/* Platform specific functions for Android */
249#ifdef __ANDROID__
250
268extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
269
290extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
291
322extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
323
331extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
332
340extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
341
349extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
350
356extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
357
362#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
363#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
364
381extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
382
398extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
399
416extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
417
428extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
429
453extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
454
465extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
466
467#endif /* __ANDROID__ */
468
469/* Platform specific functions for WinRT */
470#ifdef __WINRT__
471
475typedef enum
476{
479 SDL_WINRT_PATH_INSTALLED_LOCATION,
480
482 SDL_WINRT_PATH_LOCAL_FOLDER,
483
488 SDL_WINRT_PATH_ROAMING_FOLDER,
489
492 SDL_WINRT_PATH_TEMP_FOLDER
493} SDL_WinRT_Path;
494
495
499typedef enum
500{
502 SDL_WINRT_DEVICEFAMILY_UNKNOWN,
503
505 SDL_WINRT_DEVICEFAMILY_DESKTOP,
506
508 SDL_WINRT_DEVICEFAMILY_MOBILE,
509
511 SDL_WINRT_DEVICEFAMILY_XBOX,
512} SDL_WinRT_DeviceFamily;
513
514
536extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
537
559extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
560
568extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
569
570#endif /* __WINRT__ */
571
581extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
582
583/* Functions used by iOS application delegates to notify SDL about state changes */
584extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
585extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
586extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
587extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
588extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
589extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
590#ifdef __IPHONEOS__
591extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
592#endif
593
594/* Functions used only by GDK */
595#if defined(__GDK__)
596typedef struct XTaskQueueObject * XTaskQueueHandle;
597
611extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue);
612
613#endif
614
615/* Ends C function definitions when using C++ */
616#ifdef __cplusplus
617}
618#endif
619#include "close_code.h"
620
621#endif /* SDL_system_h_ */
622
623/* vi: set ts=4 sw=4 expandtab: */
DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void)
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:95