2015-06-21 18:33:46 +03:00
|
|
|
/*
|
|
|
|
Simple DirectMedia Layer
|
2024-01-02 00:15:26 +03:00
|
|
|
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
2015-06-21 18:33:46 +03:00
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2024-05-16 17:44:37 +03:00
|
|
|
* # CategorySystem
|
2015-06-21 18:33:46 +03:00
|
|
|
*
|
2024-05-16 17:44:37 +03:00
|
|
|
* Platform-specific SDL API functions.
|
2015-06-21 18:33:46 +03:00
|
|
|
*/
|
|
|
|
|
2016-11-21 08:34:54 +03:00
|
|
|
#ifndef SDL_system_h_
|
|
|
|
#define SDL_system_h_
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2022-11-27 07:43:38 +03:00
|
|
|
#include <SDL3/SDL_stdinc.h>
|
2024-04-04 19:38:21 +03:00
|
|
|
#include <SDL3/SDL_error.h>
|
2022-11-27 07:43:38 +03:00
|
|
|
#include <SDL3/SDL_keyboard.h>
|
|
|
|
#include <SDL3/SDL_render.h>
|
|
|
|
#include <SDL3/SDL_video.h>
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2022-12-22 19:38:59 +03:00
|
|
|
#include <SDL3/SDL_begin_code.h>
|
2015-06-21 18:33:46 +03:00
|
|
|
/* Set up for C function definitions, even when using C++ */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2023-11-08 01:38:19 +03:00
|
|
|
/*
|
|
|
|
* Platform specific functions for Windows
|
|
|
|
*/
|
2024-01-24 04:40:51 +03:00
|
|
|
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
2023-01-30 00:30:55 +03:00
|
|
|
|
2023-11-08 01:38:19 +03:00
|
|
|
typedef struct tagMSG MSG;
|
2024-05-03 22:37:11 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A callback to be used with SDL_SetWindowsMessageHook.
|
|
|
|
*
|
2024-05-03 22:40:33 +03:00
|
|
|
* This callback may modify the message, and should return SDL_TRUE if the
|
|
|
|
* message should continue to be processed, or SDL_FALSE to prevent further
|
|
|
|
* processing.
|
2024-05-03 22:37:11 +03:00
|
|
|
*
|
2024-05-03 22:40:33 +03:00
|
|
|
* As this is processing a message directly from the Windows event loop, this
|
|
|
|
* callback should do the minimum required work and return quickly.
|
2024-05-03 22:37:11 +03:00
|
|
|
*
|
2024-05-03 22:40:33 +03:00
|
|
|
* \param userdata the app-defined pointer provided to
|
|
|
|
* SDL_SetWindowsMessageHook.
|
2024-05-03 22:37:11 +03:00
|
|
|
* \param msg a pointer to a Win32 event structure to process.
|
|
|
|
* \returns SDL_TRUE to let event continue on, SDL_FALSE to drop it.
|
|
|
|
*
|
2024-05-03 22:40:33 +03:00
|
|
|
* \threadsafety This may only be called (by SDL) from the thread handling the
|
|
|
|
* Windows event loop.
|
2024-05-03 22:37:11 +03:00
|
|
|
*
|
|
|
|
* \since This datatype is available since SDL 3.0.0.
|
|
|
|
*
|
|
|
|
* \sa SDL_SetWindowsMessageHook
|
|
|
|
* \sa SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP
|
|
|
|
*/
|
2023-11-08 01:38:19 +03:00
|
|
|
typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
|
2023-11-10 04:11:23 +03:00
|
|
|
|
2015-06-21 18:33:46 +03:00
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Set a callback for every Windows message, run before TranslateMessage().
|
|
|
|
*
|
2023-11-10 04:11:23 +03:00
|
|
|
* The callback may modify the message, and should return SDL_TRUE if the
|
|
|
|
* message should continue to be processed, or SDL_FALSE to prevent further
|
|
|
|
* processing.
|
2023-11-08 01:38:19 +03:00
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param callback the SDL_WindowsMessageHook function to call.
|
|
|
|
* \param userdata a pointer to pass to every iteration of `callback`.
|
2021-09-17 22:17:05 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2024-05-03 22:37:11 +03:00
|
|
|
*
|
|
|
|
* \sa SDL_WindowsMessageHook
|
|
|
|
* \sa SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP
|
2021-03-21 21:18:39 +03:00
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) */
|
2022-06-27 20:19:39 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
2022-06-27 20:19:39 +03:00
|
|
|
|
2021-03-21 21:18:39 +03:00
|
|
|
/**
|
2023-01-30 00:30:55 +03:00
|
|
|
* Get the D3D9 adapter index that matches the specified display.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
|
|
|
* The returned adapter index can be passed to `IDirect3D9::CreateDevice` and
|
|
|
|
* controls on which monitor a full screen application will appear.
|
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param displayID the instance of the display to query.
|
2021-03-21 21:18:39 +03:00
|
|
|
* \returns the D3D9 adapter index on success or a negative error code on
|
|
|
|
* failure; call SDL_GetError() for more information.
|
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-03-21 21:18:39 +03:00
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID);
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
|
2022-06-27 20:19:39 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
2022-06-27 20:19:39 +03:00
|
|
|
|
2015-06-21 18:33:46 +03:00
|
|
|
/**
|
2023-01-30 00:30:55 +03:00
|
|
|
* Get the DXGI Adapter and Output indices for the specified display.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
|
|
|
* The DXGI Adapter and Output indices can be passed to `EnumAdapters` and
|
|
|
|
* `EnumOutputs` respectively to get the objects required to create a DX10 or
|
|
|
|
* DX11 device and swap chain.
|
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param displayID the instance of the display to query.
|
|
|
|
* \param adapterIndex a pointer to be filled in with the adapter index.
|
|
|
|
* \param outputIndex a pointer to be filled in with the output index.
|
2024-07-16 17:46:08 +03:00
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2015-06-21 18:33:46 +03:00
|
|
|
*/
|
2024-07-16 17:46:08 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2023-11-08 01:38:19 +03:00
|
|
|
/*
|
|
|
|
* Platform specific functions for UNIX
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef union _XEvent XEvent;
|
|
|
|
typedef SDL_bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent);
|
2023-11-10 04:11:23 +03:00
|
|
|
|
2023-11-08 01:38:19 +03:00
|
|
|
/**
|
2024-04-09 05:36:57 +03:00
|
|
|
* Set a callback for every X11 event.
|
2023-11-08 01:38:19 +03:00
|
|
|
*
|
2023-11-10 04:11:23 +03:00
|
|
|
* The callback may modify the event, and should return SDL_TRUE if the event
|
|
|
|
* should continue to be processed, or SDL_FALSE to prevent further
|
|
|
|
* processing.
|
2023-11-08 01:38:19 +03:00
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param callback the SDL_X11EventHook function to call.
|
|
|
|
* \param userdata a pointer to pass to every iteration of `callback`.
|
2023-11-08 01:38:19 +03:00
|
|
|
*
|
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata);
|
2023-11-08 01:38:19 +03:00
|
|
|
|
2024-04-09 05:36:57 +03:00
|
|
|
/* Platform specific functions for Linux*/
|
2024-01-24 04:40:51 +03:00
|
|
|
#ifdef SDL_PLATFORM_LINUX
|
2018-04-24 05:18:52 +03:00
|
|
|
|
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Sets the UNIX nice value for a thread.
|
|
|
|
*
|
|
|
|
* This uses setpriority() if possible, and RealtimeKit if available.
|
|
|
|
*
|
|
|
|
* \param threadID the Unix thread ID to change priority of.
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param priority the new, Unix-specific, priority value.
|
2024-07-19 22:23:24 +03:00
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2021-10-27 04:36:05 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2018-04-24 05:18:52 +03:00
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
|
2021-11-02 23:56:14 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the priority (not nice level) and scheduling policy for a thread.
|
|
|
|
*
|
|
|
|
* This uses setpriority() if possible, and RealtimeKit if available.
|
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param threadID the Unix thread ID to change priority of.
|
|
|
|
* \param sdlPriority the new SDL_ThreadPriority value.
|
|
|
|
* \param schedPolicy the new scheduling policy (SCHED_FIFO, SCHED_RR,
|
|
|
|
* SCHED_OTHER, etc...).
|
2023-02-12 12:09:42 +03:00
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2021-11-11 00:05:03 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-11-02 23:56:14 +03:00
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
2023-01-30 00:30:55 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#endif /* SDL_PLATFORM_LINUX */
|
2023-01-30 00:30:55 +03:00
|
|
|
|
2023-11-08 01:38:19 +03:00
|
|
|
/*
|
|
|
|
* Platform specific functions for iOS
|
|
|
|
*/
|
2024-01-24 04:40:51 +03:00
|
|
|
#ifdef SDL_PLATFORM_IOS
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2024-06-12 22:07:39 +03:00
|
|
|
/**
|
|
|
|
* The prototype for an Apple iOS animation callback.
|
|
|
|
*
|
|
|
|
* This datatype is only useful on Apple iOS.
|
|
|
|
*
|
2024-06-12 22:10:53 +03:00
|
|
|
* After passing a function pointer of this type to
|
2024-07-16 02:13:23 +03:00
|
|
|
* SDL_SetiOSAnimationCallback, the system will call that function pointer at
|
2024-06-12 22:10:53 +03:00
|
|
|
* a regular interval.
|
2024-06-12 22:07:39 +03:00
|
|
|
*
|
2024-06-12 22:10:53 +03:00
|
|
|
* \param userdata what was passed as `callbackParam` to
|
2024-07-16 02:13:23 +03:00
|
|
|
* SDL_SetiOSAnimationCallback as `callbackParam`.
|
2024-06-12 22:07:39 +03:00
|
|
|
*
|
|
|
|
* \since This datatype is available since SDL 3.0.0.
|
|
|
|
*
|
2024-07-16 02:13:23 +03:00
|
|
|
* \sa SDL_SetiOSAnimationCallback
|
2024-06-12 22:07:39 +03:00
|
|
|
*/
|
|
|
|
typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata);
|
|
|
|
|
2021-10-09 03:22:48 +03:00
|
|
|
/**
|
2024-04-13 21:59:10 +03:00
|
|
|
* Use this function to set the animation callback on Apple iOS.
|
|
|
|
*
|
2021-10-09 03:22:48 +03:00
|
|
|
* The function prototype for `callback` is:
|
|
|
|
*
|
|
|
|
* ```c
|
Standardize placement of '*' in function declarations
Implemented using these sed commands on the headers:
sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' *
sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' *
sed -E -i'' 's,\*const,* const,g' *
sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' *
sed -E -i'' 's,void\(,void (,g' *
git checkout *gl*
2024-07-18 18:54:50 +03:00
|
|
|
* void callback(void *callbackParam);
|
2021-10-09 03:22:48 +03:00
|
|
|
* ```
|
|
|
|
*
|
|
|
|
* Where its parameter, `callbackParam`, is what was passed as `callbackParam`
|
2024-07-16 02:13:23 +03:00
|
|
|
* to SDL_SetiOSAnimationCallback().
|
2021-10-09 03:22:48 +03:00
|
|
|
*
|
|
|
|
* This function is only available on Apple iOS.
|
|
|
|
*
|
|
|
|
* For more information see:
|
2024-04-13 22:14:32 +03:00
|
|
|
*
|
|
|
|
* https://wiki.libsdl.org/SDL3/README/ios
|
|
|
|
*
|
|
|
|
* Note that if you use the "main callbacks" instead of a standard C `main`
|
|
|
|
* function, you don't have to use this API, as SDL will manage this for you.
|
|
|
|
*
|
|
|
|
* Details on main callbacks are here:
|
|
|
|
*
|
|
|
|
* https://wiki.libsdl.org/SDL3/README/main-functions
|
2021-10-09 03:22:48 +03:00
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param window the window for which the animation callback should be set.
|
2021-10-09 03:22:48 +03:00
|
|
|
* \param interval the number of frames after which **callback** will be
|
2024-06-14 09:09:55 +03:00
|
|
|
* called.
|
2021-10-09 03:22:48 +03:00
|
|
|
* \param callback the function to call for every frame.
|
|
|
|
* \param callbackParam a pointer that is passed to `callback`.
|
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-10-09 03:22:48 +03:00
|
|
|
*
|
2024-07-16 02:13:23 +03:00
|
|
|
* \sa SDL_SetiOSEventPump
|
2021-10-09 03:22:48 +03:00
|
|
|
*/
|
Standardize placement of '*' in function declarations
Implemented using these sed commands on the headers:
sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' *
sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' *
sed -E -i'' 's,\*const,* const,g' *
sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' *
sed -E -i'' 's,void\(,void (,g' *
git checkout *gl*
2024-07-18 18:54:50 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
|
2021-10-09 03:22:48 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Use this function to enable or disable the SDL event pump on Apple iOS.
|
|
|
|
*
|
|
|
|
* This function is only available on Apple iOS.
|
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it.
|
2021-10-09 03:22:48 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-10-09 03:22:48 +03:00
|
|
|
*
|
2024-07-16 02:13:23 +03:00
|
|
|
* \sa SDL_SetiOSAnimationCallback
|
2021-10-09 03:22:48 +03:00
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(SDL_bool enabled);
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#endif /* SDL_PLATFORM_IOS */
|
2015-06-21 18:33:46 +03:00
|
|
|
|
|
|
|
|
2023-11-08 01:38:19 +03:00
|
|
|
/*
|
|
|
|
* Platform specific functions for Android
|
|
|
|
*/
|
2024-01-24 04:40:51 +03:00
|
|
|
#ifdef SDL_PLATFORM_ANDROID
|
2015-06-21 18:33:46 +03:00
|
|
|
|
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Get the Android Java Native Interface Environment of the current thread.
|
|
|
|
*
|
|
|
|
* This is the JNIEnv one needs to access the Java virtual machine from native
|
|
|
|
* code, and is needed for many Android APIs to be usable from C.
|
|
|
|
*
|
|
|
|
* The prototype of the function in SDL's code actually declare a void* return
|
|
|
|
* type, even if the implementation returns a pointer to a JNIEnv. The
|
|
|
|
* rationale being that the SDL headers can avoid including jni.h.
|
|
|
|
*
|
|
|
|
* \returns a pointer to Java native interface object (JNIEnv) to which the
|
2024-07-19 22:23:24 +03:00
|
|
|
* current thread is attached, or NULL on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2024-05-22 03:41:09 +03:00
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2024-07-16 02:13:23 +03:00
|
|
|
* \sa SDL_GetAndroidActivity
|
2015-06-21 18:33:46 +03:00
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidJNIEnv(void);
|
2015-06-21 18:33:46 +03:00
|
|
|
|
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Retrieve the Java instance of the Android activity class.
|
|
|
|
*
|
|
|
|
* The prototype of the function in SDL's code actually declares a void*
|
|
|
|
* return type, even if the implementation returns a jobject. The rationale
|
|
|
|
* being that the SDL headers can avoid including jni.h.
|
|
|
|
*
|
2021-07-15 00:07:04 +03:00
|
|
|
* The jobject returned by the function is a local reference and must be
|
|
|
|
* released by the caller. See the PushLocalFrame() and PopLocalFrame() or
|
2021-03-21 21:18:39 +03:00
|
|
|
* DeleteLocalRef() functions of the Java native interface:
|
|
|
|
*
|
|
|
|
* https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html
|
|
|
|
*
|
|
|
|
* \returns the jobject representing the instance of the Activity class of the
|
2024-07-19 22:23:24 +03:00
|
|
|
* Android application, or NULL on failure; call SDL_GetError() for
|
|
|
|
* more information.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2024-05-22 03:41:09 +03:00
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2024-07-16 02:13:23 +03:00
|
|
|
* \sa SDL_GetAndroidJNIEnv
|
2015-06-21 18:33:46 +03:00
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidActivity(void);
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2020-02-18 00:54:45 +03:00
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Query Android API level of the current device.
|
|
|
|
*
|
2023-10-19 20:13:15 +03:00
|
|
|
* - API level 34: Android 14 (UPSIDE_DOWN_CAKE)
|
|
|
|
* - API level 33: Android 13 (TIRAMISU)
|
|
|
|
* - API level 32: Android 12L (S_V2)
|
|
|
|
* - API level 31: Android 12 (S)
|
|
|
|
* - API level 30: Android 11 (R)
|
|
|
|
* - API level 29: Android 10 (Q)
|
|
|
|
* - API level 28: Android 9 (P)
|
|
|
|
* - API level 27: Android 8.1 (O_MR1)
|
|
|
|
* - API level 26: Android 8.0 (O)
|
|
|
|
* - API level 25: Android 7.1 (N_MR1)
|
|
|
|
* - API level 24: Android 7.0 (N)
|
|
|
|
* - API level 23: Android 6.0 (M)
|
|
|
|
* - API level 22: Android 5.1 (LOLLIPOP_MR1)
|
|
|
|
* - API level 21: Android 5.0 (LOLLIPOP, L)
|
2023-10-19 20:12:34 +03:00
|
|
|
* - API level 20: Android 4.4W (KITKAT_WATCH)
|
2023-10-19 20:13:15 +03:00
|
|
|
* - API level 19: Android 4.4 (KITKAT)
|
|
|
|
* - API level 18: Android 4.3 (JELLY_BEAN_MR2)
|
|
|
|
* - API level 17: Android 4.2 (JELLY_BEAN_MR1)
|
|
|
|
* - API level 16: Android 4.1 (JELLY_BEAN)
|
2023-10-19 20:12:34 +03:00
|
|
|
* - API level 15: Android 4.0.3 (ICE_CREAM_SANDWICH_MR1)
|
2023-10-19 20:13:15 +03:00
|
|
|
* - API level 14: Android 4.0 (ICE_CREAM_SANDWICH)
|
|
|
|
* - API level 13: Android 3.2 (HONEYCOMB_MR2)
|
|
|
|
* - API level 12: Android 3.1 (HONEYCOMB_MR1)
|
|
|
|
* - API level 11: Android 3.0 (HONEYCOMB)
|
2023-10-19 20:12:34 +03:00
|
|
|
* - API level 10: Android 2.3.3 (GINGERBREAD_MR1)
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2021-07-14 21:15:30 +03:00
|
|
|
* \returns the Android API level.
|
2021-10-27 04:36:05 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2020-02-18 00:54:45 +03:00
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
|
2020-02-18 00:54:45 +03:00
|
|
|
|
2018-02-07 02:03:35 +03:00
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Query if the application is running on Android TV.
|
|
|
|
*
|
|
|
|
* \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise.
|
2021-10-27 04:36:05 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2018-02-07 02:03:35 +03:00
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
2018-02-07 02:03:35 +03:00
|
|
|
|
2018-06-05 22:46:13 +03:00
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Query if the application is running on a Chromebook.
|
|
|
|
*
|
|
|
|
* \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise.
|
2021-10-27 04:36:05 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2018-06-05 22:46:13 +03:00
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
2018-06-05 22:46:13 +03:00
|
|
|
|
2018-06-18 23:14:02 +03:00
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Query if the application is running on a Samsung DeX docking station.
|
|
|
|
*
|
|
|
|
* \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise.
|
2021-10-27 04:36:05 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2018-06-18 23:14:02 +03:00
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
2018-06-18 23:14:02 +03:00
|
|
|
|
2018-07-12 23:28:13 +03:00
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Trigger the Android system back button behavior.
|
2021-10-27 04:36:05 +03:00
|
|
|
*
|
2024-05-22 03:41:09 +03:00
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2018-07-12 23:28:13 +03:00
|
|
|
*/
|
2024-07-16 17:46:08 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void);
|
2018-07-12 23:28:13 +03:00
|
|
|
|
2015-06-21 18:33:46 +03:00
|
|
|
/**
|
2024-04-09 07:49:23 +03:00
|
|
|
* See the official Android developer guide for more information:
|
|
|
|
* http://developer.android.com/guide/topics/data/data-storage.html
|
2024-04-11 20:34:29 +03:00
|
|
|
*
|
|
|
|
* \since This macro is available since SDL 3.0.0.
|
2024-04-09 07:49:23 +03:00
|
|
|
*/
|
2015-06-21 18:33:46 +03:00
|
|
|
#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
|
|
|
|
#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
|
|
|
|
|
|
|
|
/**
|
2024-07-11 06:47:02 +03:00
|
|
|
* Get the path used for internal storage for this Android application.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
|
|
|
* This path is unique to your application and cannot be written to by other
|
|
|
|
* applications.
|
|
|
|
*
|
|
|
|
* Your internal storage path is typically:
|
|
|
|
* `/data/data/your.app.package/files`.
|
|
|
|
*
|
2024-07-11 06:47:02 +03:00
|
|
|
* This is a C wrapper over `android.content.Context.getFilesDir()`:
|
|
|
|
*
|
|
|
|
* https://developer.android.com/reference/android/content/Context#getFilesDir()
|
|
|
|
*
|
2024-07-19 22:23:24 +03:00
|
|
|
* This returns temporary memory which will be automatically freed later, and
|
|
|
|
* can be claimed with SDL_ClaimTemporaryMemory().
|
2024-06-02 05:05:21 +03:00
|
|
|
*
|
2021-03-21 21:18:39 +03:00
|
|
|
* \returns the path used for internal storage or NULL on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2024-07-16 02:13:23 +03:00
|
|
|
* \sa SDL_GetAndroidExternalStorageState
|
2015-06-21 18:33:46 +03:00
|
|
|
*/
|
Standardize placement of '*' in function declarations
Implemented using these sed commands on the headers:
sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' *
sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' *
sed -E -i'' 's,\*const,* const,g' *
sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' *
sed -E -i'' 's,void\(,void (,g' *
git checkout *gl*
2024-07-18 18:54:50 +03:00
|
|
|
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidInternalStoragePath(void);
|
2015-06-21 18:33:46 +03:00
|
|
|
|
|
|
|
/**
|
2024-07-11 06:47:02 +03:00
|
|
|
* Get the current state of external storage for this Android application.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
|
|
|
* The current state of external storage, a bitmask of these values:
|
|
|
|
* `SDL_ANDROID_EXTERNAL_STORAGE_READ`, `SDL_ANDROID_EXTERNAL_STORAGE_WRITE`.
|
|
|
|
*
|
|
|
|
* If external storage is currently unavailable, this will return 0.
|
|
|
|
*
|
2024-07-17 07:33:30 +03:00
|
|
|
* \returns the current state of external storage, or 0 if external storage is
|
|
|
|
* currently unavailable.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2024-07-16 02:13:23 +03:00
|
|
|
* \sa SDL_GetAndroidExternalStoragePath
|
2021-03-21 21:18:39 +03:00
|
|
|
*/
|
2024-07-17 07:15:56 +03:00
|
|
|
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAndroidExternalStorageState(void);
|
2015-06-21 18:33:46 +03:00
|
|
|
|
|
|
|
/**
|
2024-07-11 06:47:02 +03:00
|
|
|
* Get the path used for external storage for this Android application.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
|
|
|
* This path is unique to your application, but is public and can be written
|
|
|
|
* to by other applications.
|
|
|
|
*
|
|
|
|
* Your external storage path is typically:
|
|
|
|
* `/storage/sdcard0/Android/data/your.app.package/files`.
|
|
|
|
*
|
2024-07-11 06:47:02 +03:00
|
|
|
* This is a C wrapper over `android.content.Context.getExternalFilesDir()`:
|
|
|
|
*
|
|
|
|
* https://developer.android.com/reference/android/content/Context#getExternalFilesDir()
|
|
|
|
*
|
2024-07-19 22:23:24 +03:00
|
|
|
* This returns temporary memory which will be automatically freed later, and
|
|
|
|
* can be claimed with SDL_ClaimTemporaryMemory().
|
2024-06-02 05:05:21 +03:00
|
|
|
*
|
2021-03-21 21:18:39 +03:00
|
|
|
* \returns the path used for external storage for this application on success
|
|
|
|
* or NULL on failure; call SDL_GetError() for more information.
|
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-03-21 21:18:39 +03:00
|
|
|
*
|
2024-07-16 02:13:23 +03:00
|
|
|
* \sa SDL_GetAndroidExternalStorageState
|
2015-06-21 18:33:46 +03:00
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void);
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2024-07-11 06:47:02 +03:00
|
|
|
/**
|
|
|
|
* Get the path used for caching data for this Android application.
|
|
|
|
*
|
|
|
|
* This path is unique to your application, but is public and can be written
|
|
|
|
* to by other applications.
|
|
|
|
*
|
2024-07-12 22:42:55 +03:00
|
|
|
* Your cache path is typically: `/data/data/your.app.package/cache/`.
|
2024-07-11 06:47:02 +03:00
|
|
|
*
|
|
|
|
* This is a C wrapper over `android.content.Context.getCacheDir()`:
|
|
|
|
*
|
|
|
|
* https://developer.android.com/reference/android/content/Context#getCacheDir()
|
|
|
|
*
|
2024-07-19 22:23:24 +03:00
|
|
|
* This returns temporary memory which will be automatically freed later, and
|
|
|
|
* can be claimed with SDL_ClaimTemporaryMemory().
|
2024-07-11 06:47:02 +03:00
|
|
|
*
|
2024-07-12 22:42:55 +03:00
|
|
|
* \returns the path used for caches for this application on success or NULL
|
|
|
|
* on failure; call SDL_GetError() for more information.
|
2024-07-11 06:47:02 +03:00
|
|
|
*
|
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidCachePath(void);
|
2024-07-11 06:47:02 +03:00
|
|
|
|
2024-02-12 23:26:09 +03:00
|
|
|
|
2024-07-16 17:46:08 +03:00
|
|
|
typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
|
2024-02-12 23:26:09 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Request permissions at runtime, asynchronously.
|
|
|
|
*
|
|
|
|
* You do not need to call this for built-in functionality of SDL; recording
|
2024-02-13 20:07:23 +03:00
|
|
|
* from a microphone or reading images from a camera, using standard SDL APIs,
|
|
|
|
* will manage permission requests for you.
|
2024-02-12 23:26:09 +03:00
|
|
|
*
|
|
|
|
* This function never blocks. Instead, the app-supplied callback will be
|
|
|
|
* called when a decision has been made. This callback may happen on a
|
|
|
|
* different thread, and possibly much later, as it might wait on a user to
|
2024-02-13 20:07:23 +03:00
|
|
|
* respond to a system dialog. If permission has already been granted for a
|
|
|
|
* specific entitlement, the callback will still fire, probably on the current
|
|
|
|
* thread and before this function returns.
|
|
|
|
*
|
|
|
|
* If the request submission fails, this function returns -1 and the callback
|
|
|
|
* will NOT be called, but this should only happen in catastrophic conditions,
|
|
|
|
* like memory running out. Normally there will be a yes or no to the request
|
|
|
|
* through the callback.
|
2024-02-12 23:26:09 +03:00
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param permission the permission to request.
|
|
|
|
* \param cb the callback to trigger when the request has a response.
|
|
|
|
* \param userdata an app-controlled pointer that is passed to the callback.
|
2024-02-12 23:26:09 +03:00
|
|
|
* \returns zero if the request was submitted, -1 if there was an error
|
|
|
|
* submitting. The result of the request is only ever reported
|
|
|
|
* through the callback, not this return value.
|
|
|
|
*
|
2024-05-22 03:41:09 +03:00
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2024-02-12 23:26:09 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-07-16 17:46:08 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
|
2024-02-12 23:26:09 +03:00
|
|
|
|
2021-02-19 12:54:57 +03:00
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Shows an Android toast notification.
|
|
|
|
*
|
|
|
|
* Toasts are a sort of lightweight notification that are unique to Android.
|
|
|
|
*
|
|
|
|
* https://developer.android.com/guide/topics/ui/notifiers/toasts
|
|
|
|
*
|
|
|
|
* Shows toast in UI thread.
|
|
|
|
*
|
|
|
|
* For the `gravity` parameter, choose a value from here, or -1 if you don't
|
|
|
|
* have a preference:
|
|
|
|
*
|
|
|
|
* https://developer.android.com/reference/android/view/Gravity
|
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param message text message to be shown.
|
|
|
|
* \param duration 0=short, 1=long.
|
2021-03-21 21:18:39 +03:00
|
|
|
* \param gravity where the notification should appear on the screen.
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param xoffset set this parameter only when gravity >=0.
|
|
|
|
* \param yoffset set this parameter only when gravity >=0.
|
2023-02-12 12:09:42 +03:00
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2021-09-17 22:19:06 +03:00
|
|
|
*
|
2024-05-22 03:41:09 +03:00
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2021-03-21 21:18:39 +03:00
|
|
|
*/
|
Standardize placement of '*' in function declarations
Implemented using these sed commands on the headers:
sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' *
sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' *
sed -E -i'' 's,\*const,* const,g' *
sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' *
sed -E -i'' 's,void\(,void (,g' *
git checkout *gl*
2024-07-18 18:54:50 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset);
|
2021-02-19 12:54:57 +03:00
|
|
|
|
2022-02-01 13:30:43 +03:00
|
|
|
/**
|
2022-02-01 13:37:05 +03:00
|
|
|
* Send a user command to SDLActivity.
|
|
|
|
*
|
|
|
|
* Override "boolean onUnhandledMessage(Message msg)" to handle the message.
|
2022-02-01 13:30:43 +03:00
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param command user command that must be greater or equal to 0x8000.
|
|
|
|
* \param param user parameter.
|
2023-02-11 00:26:35 +03:00
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2022-02-01 13:33:04 +03:00
|
|
|
*
|
2024-05-22 03:41:09 +03:00
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2022-02-01 13:30:43 +03:00
|
|
|
*/
|
2024-07-16 17:46:08 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
|
2022-02-01 13:30:43 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#endif /* SDL_PLATFORM_ANDROID */
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2023-11-08 01:38:19 +03:00
|
|
|
/*
|
|
|
|
* Platform specific functions for WinRT
|
|
|
|
*/
|
2024-01-24 04:40:51 +03:00
|
|
|
#ifdef SDL_PLATFORM_WINRT
|
2022-11-23 21:41:43 +03:00
|
|
|
|
|
|
|
/**
|
2024-04-09 07:49:23 +03:00
|
|
|
* WinRT / Windows Phone path types
|
2024-04-11 20:34:29 +03:00
|
|
|
*
|
|
|
|
* \since This enum is available since SDL 3.0.0.
|
2022-11-23 21:41:43 +03:00
|
|
|
*/
|
2024-04-09 05:36:57 +03:00
|
|
|
typedef enum SDL_WinRT_Path
|
2022-11-23 21:41:43 +03:00
|
|
|
{
|
2023-11-06 18:26:06 +03:00
|
|
|
/** The installed app's root directory.
|
2022-11-23 21:41:43 +03:00
|
|
|
Files here are likely to be read-only. */
|
|
|
|
SDL_WINRT_PATH_INSTALLED_LOCATION,
|
|
|
|
|
2023-11-06 18:26:06 +03:00
|
|
|
/** The app's local data store. Files may be written here */
|
2022-11-23 21:41:43 +03:00
|
|
|
SDL_WINRT_PATH_LOCAL_FOLDER,
|
|
|
|
|
2023-11-06 18:26:06 +03:00
|
|
|
/** The app's roaming data store. Unsupported on Windows Phone.
|
2022-11-23 21:41:43 +03:00
|
|
|
Files written here may be copied to other machines via a network
|
|
|
|
connection.
|
|
|
|
*/
|
|
|
|
SDL_WINRT_PATH_ROAMING_FOLDER,
|
|
|
|
|
2023-11-06 18:26:06 +03:00
|
|
|
/** The app's temporary data store. Unsupported on Windows Phone.
|
2022-11-23 21:41:43 +03:00
|
|
|
Files written here may be deleted at any time. */
|
|
|
|
SDL_WINRT_PATH_TEMP_FOLDER
|
|
|
|
} SDL_WinRT_Path;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2024-04-09 07:49:23 +03:00
|
|
|
* WinRT Device Family
|
2024-04-11 20:34:29 +03:00
|
|
|
*
|
|
|
|
* \since This enum is available since SDL 3.0.0.
|
2022-11-23 21:41:43 +03:00
|
|
|
*/
|
2024-04-09 05:36:57 +03:00
|
|
|
typedef enum SDL_WinRT_DeviceFamily
|
2022-11-23 21:41:43 +03:00
|
|
|
{
|
2023-11-06 18:26:06 +03:00
|
|
|
/** Unknown family */
|
2022-11-23 21:41:43 +03:00
|
|
|
SDL_WINRT_DEVICEFAMILY_UNKNOWN,
|
|
|
|
|
2023-11-06 18:26:06 +03:00
|
|
|
/** Desktop family*/
|
2022-11-23 21:41:43 +03:00
|
|
|
SDL_WINRT_DEVICEFAMILY_DESKTOP,
|
|
|
|
|
2023-11-06 18:26:06 +03:00
|
|
|
/** Mobile family (for example smartphone) */
|
2022-11-23 21:41:43 +03:00
|
|
|
SDL_WINRT_DEVICEFAMILY_MOBILE,
|
|
|
|
|
2023-11-06 18:26:06 +03:00
|
|
|
/** XBox family */
|
2022-11-23 21:41:43 +03:00
|
|
|
SDL_WINRT_DEVICEFAMILY_XBOX,
|
|
|
|
} SDL_WinRT_DeviceFamily;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve a WinRT defined path on the local file system.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Documentation on most app-specific path types on WinRT can be found on
|
|
|
|
* MSDN, at the URL:
|
|
|
|
*
|
|
|
|
* https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
|
|
|
*
|
2024-07-19 22:23:24 +03:00
|
|
|
* This returns temporary memory which will be automatically freed later, and
|
|
|
|
* can be claimed with SDL_ClaimTemporaryMemory().
|
2024-06-02 05:05:21 +03:00
|
|
|
*
|
2024-06-14 09:09:55 +03:00
|
|
|
* \param pathType the type of path to retrieve, one of SDL_WinRT_Path.
|
2022-11-23 21:41:43 +03:00
|
|
|
* \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if
|
|
|
|
* the path is not available for any reason; call SDL_GetError() for
|
|
|
|
* more information.
|
|
|
|
*
|
2024-04-13 15:07:27 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2022-11-23 21:41:43 +03:00
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC const char * SDLCALL SDL_GetWinRTFSPath(SDL_WinRT_Path pathType);
|
2022-11-23 21:41:43 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Detects the device family of WinRT platform at runtime.
|
|
|
|
*
|
|
|
|
* \returns a value from the SDL_WinRT_DeviceFamily enum.
|
|
|
|
*
|
2022-11-23 21:43:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2022-11-23 21:41:43 +03:00
|
|
|
*/
|
2024-07-16 02:13:23 +03:00
|
|
|
extern SDL_DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_GetWinRTDeviceFamily();
|
2022-11-23 21:41:43 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#endif /* SDL_PLATFORM_WINRT */
|
2022-11-23 21:41:43 +03:00
|
|
|
|
2018-08-22 06:03:54 +03:00
|
|
|
/**
|
2021-03-21 21:18:39 +03:00
|
|
|
* Query if the current device is a tablet.
|
|
|
|
*
|
|
|
|
* If SDL can't determine this, it will return SDL_FALSE.
|
|
|
|
*
|
|
|
|
* \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
|
2021-10-27 04:36:05 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2018-08-22 06:03:54 +03:00
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
|
2018-08-22 06:03:54 +03:00
|
|
|
|
2024-05-03 20:01:41 +03:00
|
|
|
/* Functions used by iOS app delegates to notify SDL about state changes. */
|
2023-02-12 22:39:22 +03:00
|
|
|
|
2024-05-03 20:01:41 +03:00
|
|
|
/**
|
|
|
|
* Let iOS apps with external event handling report
|
|
|
|
* onApplicationWillTerminate.
|
|
|
|
*
|
|
|
|
* This functions allows iOS apps that have their own event handling to hook
|
|
|
|
* into SDL to generate SDL events. This maps directly to an iOS-specific
|
|
|
|
* event, but since it doesn't do anything iOS-specific internally, it is
|
|
|
|
* available on all platforms, in case it might be useful for some specific
|
|
|
|
* paradigm. Most apps do not need to use this directly; SDL's internal event
|
|
|
|
* code will handle all this for windows created by SDL_CreateWindow!
|
|
|
|
*
|
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2023-02-12 22:39:22 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
|
2023-02-12 22:39:22 +03:00
|
|
|
|
2024-05-03 20:01:41 +03:00
|
|
|
/**
|
|
|
|
* Let iOS apps with external event handling report
|
|
|
|
* onApplicationDidReceiveMemoryWarning.
|
|
|
|
*
|
|
|
|
* This functions allows iOS apps that have their own event handling to hook
|
|
|
|
* into SDL to generate SDL events. This maps directly to an iOS-specific
|
|
|
|
* event, but since it doesn't do anything iOS-specific internally, it is
|
|
|
|
* available on all platforms, in case it might be useful for some specific
|
|
|
|
* paradigm. Most apps do not need to use this directly; SDL's internal event
|
|
|
|
* code will handle all this for windows created by SDL_CreateWindow!
|
|
|
|
*
|
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2023-02-12 22:39:22 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
|
2023-02-12 22:39:22 +03:00
|
|
|
|
2024-05-03 20:01:41 +03:00
|
|
|
/**
|
|
|
|
* Let iOS apps with external event handling report
|
|
|
|
* onApplicationWillResignActive.
|
|
|
|
*
|
|
|
|
* This functions allows iOS apps that have their own event handling to hook
|
|
|
|
* into SDL to generate SDL events. This maps directly to an iOS-specific
|
|
|
|
* event, but since it doesn't do anything iOS-specific internally, it is
|
|
|
|
* available on all platforms, in case it might be useful for some specific
|
|
|
|
* paradigm. Most apps do not need to use this directly; SDL's internal event
|
|
|
|
* code will handle all this for windows created by SDL_CreateWindow!
|
|
|
|
*
|
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2023-02-12 22:39:22 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
|
2023-02-12 22:39:22 +03:00
|
|
|
|
2024-05-03 20:01:41 +03:00
|
|
|
/**
|
|
|
|
* Let iOS apps with external event handling report
|
|
|
|
* onApplicationDidEnterBackground.
|
|
|
|
*
|
|
|
|
* This functions allows iOS apps that have their own event handling to hook
|
|
|
|
* into SDL to generate SDL events. This maps directly to an iOS-specific
|
|
|
|
* event, but since it doesn't do anything iOS-specific internally, it is
|
|
|
|
* available on all platforms, in case it might be useful for some specific
|
|
|
|
* paradigm. Most apps do not need to use this directly; SDL's internal event
|
|
|
|
* code will handle all this for windows created by SDL_CreateWindow!
|
|
|
|
*
|
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2023-02-12 22:39:22 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
|
2023-02-12 22:39:22 +03:00
|
|
|
|
2024-05-03 20:01:41 +03:00
|
|
|
/**
|
|
|
|
* Let iOS apps with external event handling report
|
|
|
|
* onApplicationWillEnterForeground.
|
|
|
|
*
|
|
|
|
* This functions allows iOS apps that have their own event handling to hook
|
|
|
|
* into SDL to generate SDL events. This maps directly to an iOS-specific
|
|
|
|
* event, but since it doesn't do anything iOS-specific internally, it is
|
|
|
|
* available on all platforms, in case it might be useful for some specific
|
|
|
|
* paradigm. Most apps do not need to use this directly; SDL's internal event
|
|
|
|
* code will handle all this for windows created by SDL_CreateWindow!
|
|
|
|
*
|
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2023-02-12 22:39:22 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
|
2023-02-12 22:39:22 +03:00
|
|
|
|
2024-05-03 20:01:41 +03:00
|
|
|
/**
|
|
|
|
* Let iOS apps with external event handling report
|
|
|
|
* onApplicationDidBecomeActive.
|
|
|
|
*
|
|
|
|
* This functions allows iOS apps that have their own event handling to hook
|
|
|
|
* into SDL to generate SDL events. This maps directly to an iOS-specific
|
|
|
|
* event, but since it doesn't do anything iOS-specific internally, it is
|
|
|
|
* available on all platforms, in case it might be useful for some specific
|
|
|
|
* paradigm. Most apps do not need to use this directly; SDL's internal event
|
|
|
|
* code will handle all this for windows created by SDL_CreateWindow!
|
|
|
|
*
|
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2023-02-12 22:39:22 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
2023-02-12 22:39:22 +03:00
|
|
|
|
2024-01-24 04:40:51 +03:00
|
|
|
#ifdef SDL_PLATFORM_IOS
|
2024-05-03 20:01:41 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Let iOS apps with external event handling report
|
|
|
|
* onApplicationDidChangeStatusBarOrientation.
|
|
|
|
*
|
|
|
|
* This functions allows iOS apps that have their own event handling to hook
|
|
|
|
* into SDL to generate SDL events. This maps directly to an iOS-specific
|
|
|
|
* event, but since it doesn't do anything iOS-specific internally, it is
|
|
|
|
* available on all platforms, in case it might be useful for some specific
|
|
|
|
* paradigm. Most apps do not need to use this directly; SDL's internal event
|
|
|
|
* code will handle all this for windows created by SDL_CreateWindow!
|
|
|
|
*
|
|
|
|
* \threadsafety It is safe to call this function from any thread.
|
|
|
|
*
|
2023-02-12 22:39:22 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
|
|
|
*/
|
2024-05-18 02:52:36 +03:00
|
|
|
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
|
2020-01-31 01:51:33 +03:00
|
|
|
#endif
|
|
|
|
|
2023-11-08 01:38:19 +03:00
|
|
|
/*
|
|
|
|
* Functions used only by GDK
|
|
|
|
*/
|
2024-01-24 04:40:51 +03:00
|
|
|
#ifdef SDL_PLATFORM_GDK
|
2023-08-25 17:39:39 +03:00
|
|
|
typedef struct XTaskQueueObject *XTaskQueueHandle;
|
|
|
|
typedef struct XUser *XUserHandle;
|
2022-06-27 20:19:39 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a reference to the global async task queue handle for GDK,
|
|
|
|
* initializing if needed.
|
2022-06-27 20:20:12 +03:00
|
|
|
*
|
|
|
|
* Once you are done with the task queue, you should call
|
|
|
|
* XTaskQueueCloseHandle to reduce the reference count to avoid a resource
|
|
|
|
* leak.
|
|
|
|
*
|
2022-06-27 20:19:39 +03:00
|
|
|
* \param outTaskQueue a pointer to be filled in with task queue handle.
|
2023-02-12 12:09:42 +03:00
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2022-06-27 20:20:12 +03:00
|
|
|
*
|
2022-11-23 01:40:14 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2022-06-27 20:19:39 +03:00
|
|
|
*/
|
Standardize placement of '*' in function declarations
Implemented using these sed commands on the headers:
sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' *
sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' *
sed -E -i'' 's,\*const,* const,g' *
sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' *
sed -E -i'' 's,void\(,void (,g' *
git checkout *gl*
2024-07-18 18:54:50 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue);
|
2022-06-27 20:19:39 +03:00
|
|
|
|
2023-08-25 17:39:39 +03:00
|
|
|
/**
|
|
|
|
* Gets a reference to the default user handle for GDK.
|
|
|
|
*
|
|
|
|
* This is effectively a synchronous version of XUserAddAsync, which always
|
|
|
|
* prefers the default user and allows a sign-in UI.
|
|
|
|
*
|
2023-08-25 17:42:25 +03:00
|
|
|
* \param outUserHandle a pointer to be filled in with the default user
|
|
|
|
* handle.
|
2024-07-19 22:23:24 +03:00
|
|
|
* \returns 0 if success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2023-08-25 17:39:39 +03:00
|
|
|
*
|
2024-04-11 20:35:27 +03:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2023-08-25 17:39:39 +03:00
|
|
|
*/
|
Standardize placement of '*' in function declarations
Implemented using these sed commands on the headers:
sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' *
sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' *
sed -E -i'' 's,\*const,* const,g' *
sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' *
sed -E -i'' 's,void\(,void (,g' *
git checkout *gl*
2024-07-18 18:54:50 +03:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle);
|
2023-08-25 17:39:39 +03:00
|
|
|
|
2022-06-27 20:19:39 +03:00
|
|
|
#endif
|
|
|
|
|
2015-06-21 18:33:46 +03:00
|
|
|
/* Ends C function definitions when using C++ */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2022-12-22 19:38:59 +03:00
|
|
|
#include <SDL3/SDL_close_code.h>
|
2015-06-21 18:33:46 +03:00
|
|
|
|
2016-11-21 08:34:54 +03:00
|
|
|
#endif /* SDL_system_h_ */
|