sdl (master post 3.1 preview) Merge commit 'e4f454091a943345938608570b104400f62fd625'

This commit is contained in:
2024-03-28 16:27:42 +01:00
862 changed files with 204894 additions and 45662 deletions

View File

@@ -43,7 +43,7 @@ extern "C" {
/*
* Platform specific functions for Windows
*/
#if defined(__WIN32__) || defined(__GDK__)
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
typedef struct tagMSG MSG;
typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
@@ -62,9 +62,9 @@ typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
*/
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
#endif /* defined(__WIN32__) || defined(__GDK__) */
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) */
#if defined(__WIN32__) || defined(__WINGDK__)
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
/**
* Get the D3D9 adapter index that matches the specified display.
@@ -80,9 +80,9 @@ extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook ca
*/
extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
#if defined(__WIN32__) || defined(__WINGDK__)
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
/**
* Get the DXGI Adapter and Output indices for the specified display.
@@ -101,7 +101,7 @@ extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID
*/
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
/*
* Platform specific functions for UNIX
@@ -127,7 +127,7 @@ extern DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void
/*
* Platform specific functions for Linux
*/
#ifdef __LINUX__
#ifdef SDL_PLATFORM_LINUX
/**
* Sets the UNIX nice value for a thread.
@@ -158,12 +158,12 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio
*/
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
#endif /* __LINUX__ */
#endif /* SDL_PLATFORM_LINUX */
/*
* Platform specific functions for iOS
*/
#ifdef __IOS__
#ifdef SDL_PLATFORM_IOS
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
@@ -219,13 +219,13 @@ extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window,
*/
extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
#endif /* __IOS__ */
#endif /* SDL_PLATFORM_IOS */
/*
* Platform specific functions for Android
*/
#ifdef __ANDROID__
#ifdef SDL_PLATFORM_ANDROID
/**
* Get the Android Java Native Interface Environment of the current thread.
@@ -399,17 +399,38 @@ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state);
*/
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
/**
* Request permissions at runtime.
* Request permissions at runtime, asynchronously.
*
* This blocks the calling thread until the permission is granted or denied.
* You do not need to call this for built-in functionality of SDL; recording
* from a microphone or reading images from a camera, using standard SDL APIs,
* will manage permission requests for you.
*
* 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
* 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.
*
* \param permission The permission to request.
* \returns SDL_TRUE if the permission was granted, SDL_FALSE otherwise.
* \param cb The callback to trigger when the request has a response.
* \param userdata An app-controlled pointer that is passed to the callback.
* \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.
*
* \since This function is available since SDL 3.0.0.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
extern DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata);
/**
* Shows an Android toast notification.
@@ -451,12 +472,12 @@ extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int durati
*/
extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
#endif /* __ANDROID__ */
#endif /* SDL_PLATFORM_ANDROID */
/*
* Platform specific functions for WinRT
*/
#ifdef __WINRT__
#ifdef SDL_PLATFORM_WINRT
/**
* WinRT / Windows Phone path types
@@ -556,7 +577,7 @@ extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathT
*/
extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
#endif /* __WINRT__ */
#endif /* SDL_PLATFORM_WINRT */
/**
* Query if the current device is a tablet.
@@ -610,7 +631,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
*/
extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
#ifdef __IOS__
#ifdef SDL_PLATFORM_IOS
/*
* \since This function is available since SDL 3.0.0.
*/
@@ -620,7 +641,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void
/*
* Functions used only by GDK
*/
#ifdef __GDK__
#ifdef SDL_PLATFORM_GDK
typedef struct XTaskQueueObject *XTaskQueueHandle;
typedef struct XUser *XUserHandle;