mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-30 03:04:28 +00:00
Finished renaming functions in SDL_system.h
This commit is contained in:
@@ -382,7 +382,7 @@ static int BuildAAudioStream(SDL_AudioDevice *device)
|
||||
}
|
||||
|
||||
// !!! FIXME: make this non-blocking!
|
||||
static void SDLCALL AndroidRequestPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
{
|
||||
SDL_AtomicSet((SDL_AtomicInt *) userdata, granted ? 1 : -1);
|
||||
}
|
||||
@@ -399,7 +399,7 @@ static int AAUDIO_OpenDevice(SDL_AudioDevice *device)
|
||||
// !!! FIXME: make this non-blocking!
|
||||
SDL_AtomicInt permission_response;
|
||||
SDL_AtomicSet(&permission_response, 0);
|
||||
if (SDL_AndroidRequestPermission("android.permission.RECORD_AUDIO", AndroidRequestPermissionBlockingCallback, &permission_response) == -1) {
|
||||
if (SDL_RequestAndroidPermission("android.permission.RECORD_AUDIO", RequestAndroidPermissionBlockingCallback, &permission_response) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ static void OPENSLES_DestroyPCMRecorder(SDL_AudioDevice *device)
|
||||
}
|
||||
|
||||
// !!! FIXME: make this non-blocking!
|
||||
static void SDLCALL AndroidRequestPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
{
|
||||
SDL_AtomicSet((SDL_AtomicInt *) userdata, granted ? 1 : -1);
|
||||
}
|
||||
@@ -251,7 +251,7 @@ static int OPENSLES_CreatePCMRecorder(SDL_AudioDevice *device)
|
||||
{
|
||||
SDL_AtomicInt permission_response;
|
||||
SDL_AtomicSet(&permission_response, 0);
|
||||
if (SDL_AndroidRequestPermission("android.permission.RECORD_AUDIO", AndroidRequestPermissionBlockingCallback, &permission_response) == -1) {
|
||||
if (SDL_RequestAndroidPermission("android.permission.RECORD_AUDIO", RequestAndroidPermissionBlockingCallback, &permission_response) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -559,7 +559,7 @@ static int ANDROIDCAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *sp
|
||||
|
||||
// just in case SDL_OpenCamera is overwriting device->spec as CameraPermissionCallback runs, we work from a different copy.
|
||||
SDL_copyp(&device->hidden->requested_spec, spec);
|
||||
if (SDL_AndroidRequestPermission("android.permission.CAMERA", CameraPermissionCallback, device) < 0) {
|
||||
if (SDL_RequestAndroidPermission("android.permission.CAMERA", CameraPermissionCallback, device) < 0) {
|
||||
UnrefPhysicalCamera(device);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -114,8 +114,8 @@ const char *SDL_GetWinRTFSPath(int pathType)
|
||||
|
||||
#ifndef SDL_PLATFORM_ANDROID
|
||||
|
||||
SDL_DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
||||
void SDL_AndroidBackButton()
|
||||
SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void);
|
||||
void SDL_SendAndroidBackButton()
|
||||
{
|
||||
SDL_Unsupported();
|
||||
}
|
||||
@@ -162,9 +162,9 @@ void *SDL_GetAndroidJNIEnv()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
|
||||
SDL_DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata);
|
||||
int SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata)
|
||||
typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
|
||||
SDL_DECLSPEC int SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
|
||||
int SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
|
||||
{
|
||||
(void)permission;
|
||||
(void)cb;
|
||||
@@ -172,16 +172,16 @@ int SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermi
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
SDL_DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
|
||||
int SDL_AndroidSendMessage(Uint32 command, int param)
|
||||
SDL_DECLSPEC int SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
|
||||
int SDL_SendAndroidMessage(Uint32 command, int param)
|
||||
{
|
||||
(void)command;
|
||||
(void)param;
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
SDL_DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
||||
int SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset)
|
||||
SDL_DECLSPEC int SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
||||
int SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset)
|
||||
{
|
||||
(void)message;
|
||||
(void)duration;
|
||||
|
||||
@@ -2245,7 +2245,7 @@ void Android_JNI_HapticStop(int device_id)
|
||||
/* See SDLActivity.java for constants. */
|
||||
#define COMMAND_SET_KEEP_SCREEN_ON 5
|
||||
|
||||
int SDL_AndroidSendMessage(Uint32 command, int param)
|
||||
int SDL_SendAndroidMessage(Uint32 command, int param)
|
||||
{
|
||||
if (command >= 0x8000) {
|
||||
return Android_JNI_SendMessage(command, param);
|
||||
@@ -2446,7 +2446,7 @@ SDL_bool SDL_IsDeXMode(void)
|
||||
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode);
|
||||
}
|
||||
|
||||
void SDL_AndroidBackButton(void)
|
||||
void SDL_SendAndroidBackButton(void)
|
||||
{
|
||||
JNIEnv *env = Android_JNI_GetEnv();
|
||||
(*env)->CallStaticVoidMethod(env, mActivityClass, midManualBackButton);
|
||||
@@ -2645,7 +2645,7 @@ const char *SDL_GetAndroidCachePath(void)
|
||||
return s_AndroidCachePath;
|
||||
}
|
||||
|
||||
int SDL_AndroidShowToast(const char *message, int duration, int gravity, int xOffset, int yOffset)
|
||||
int SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset)
|
||||
{
|
||||
return Android_JNI_ShowToast(message, duration, gravity, xOffset, yOffset);
|
||||
}
|
||||
@@ -2716,7 +2716,7 @@ typedef struct NativePermissionRequestInfo
|
||||
{
|
||||
int request_code;
|
||||
char *permission;
|
||||
SDL_AndroidRequestPermissionCallback callback;
|
||||
SDL_RequestAndroidPermissionCallback callback;
|
||||
void *userdata;
|
||||
struct NativePermissionRequestInfo *next;
|
||||
} NativePermissionRequestInfo;
|
||||
@@ -2744,7 +2744,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePermissionResult)(
|
||||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
}
|
||||
|
||||
int SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata)
|
||||
int SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
|
||||
{
|
||||
if (!permission) {
|
||||
return SDL_InvalidParamError("permission");
|
||||
|
||||
@@ -12,10 +12,6 @@ SDL3_0.0.0 {
|
||||
SDL_AddTimerNS;
|
||||
SDL_AddVulkanRenderSemaphores;
|
||||
SDL_AllocateEventMemory;
|
||||
SDL_AndroidBackButton;
|
||||
SDL_AndroidRequestPermission;
|
||||
SDL_AndroidSendMessage;
|
||||
SDL_AndroidShowToast;
|
||||
SDL_AtomicAdd;
|
||||
SDL_AtomicCompareAndSwap;
|
||||
SDL_AtomicCompareAndSwapPointer;
|
||||
@@ -85,7 +81,6 @@ SDL3_0.0.0 {
|
||||
SDL_CreateWindowAndRenderer;
|
||||
SDL_CreateWindowWithProperties;
|
||||
SDL_CursorVisible;
|
||||
SDL_DXGIGetOutputInfo;
|
||||
SDL_DateTimeToTime;
|
||||
SDL_DelEventWatch;
|
||||
SDL_DelHintCallback;
|
||||
@@ -204,6 +199,7 @@ SDL3_0.0.0 {
|
||||
SDL_GetCurrentTime;
|
||||
SDL_GetCurrentVideoDriver;
|
||||
SDL_GetCursor;
|
||||
SDL_GetDXGIOutputInfo;
|
||||
SDL_GetDateTimeLocalePreferences;
|
||||
SDL_GetDayOfWeek;
|
||||
SDL_GetDayOfYear;
|
||||
@@ -666,6 +662,7 @@ SDL3_0.0.0 {
|
||||
SDL_RenderTextureRotated;
|
||||
SDL_RenderViewportSet;
|
||||
SDL_ReportAssertion;
|
||||
SDL_RequestAndroidPermission;
|
||||
SDL_ResetAssertionReport;
|
||||
SDL_ResetHint;
|
||||
SDL_ResetHints;
|
||||
@@ -686,6 +683,8 @@ SDL3_0.0.0 {
|
||||
SDL_ScreenKeyboardShown;
|
||||
SDL_ScreenSaverEnabled;
|
||||
SDL_SeekIO;
|
||||
SDL_SendAndroidBackButton;
|
||||
SDL_SendAndroidMessage;
|
||||
SDL_SendGamepadEffect;
|
||||
SDL_SendJoystickEffect;
|
||||
SDL_SendJoystickVirtualSensorData;
|
||||
@@ -792,6 +791,7 @@ SDL3_0.0.0 {
|
||||
SDL_SetX11EventHook;
|
||||
SDL_SetiOSAnimationCallback;
|
||||
SDL_SetiOSEventPump;
|
||||
SDL_ShowAndroidToast;
|
||||
SDL_ShowCursor;
|
||||
SDL_ShowMessageBox;
|
||||
SDL_ShowOpenFileDialog;
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
#define SDL_AddTimerNS SDL_AddTimerNS_REAL
|
||||
#define SDL_AddVulkanRenderSemaphores SDL_AddVulkanRenderSemaphores_REAL
|
||||
#define SDL_AllocateEventMemory SDL_AllocateEventMemory_REAL
|
||||
#define SDL_AndroidBackButton SDL_AndroidBackButton_REAL
|
||||
#define SDL_AndroidRequestPermission SDL_AndroidRequestPermission_REAL
|
||||
#define SDL_AndroidSendMessage SDL_AndroidSendMessage_REAL
|
||||
#define SDL_AndroidShowToast SDL_AndroidShowToast_REAL
|
||||
#define SDL_AtomicAdd SDL_AtomicAdd_REAL
|
||||
#define SDL_AtomicCompareAndSwap SDL_AtomicCompareAndSwap_REAL
|
||||
#define SDL_AtomicCompareAndSwapPointer SDL_AtomicCompareAndSwapPointer_REAL
|
||||
@@ -110,7 +106,6 @@
|
||||
#define SDL_CreateWindowAndRenderer SDL_CreateWindowAndRenderer_REAL
|
||||
#define SDL_CreateWindowWithProperties SDL_CreateWindowWithProperties_REAL
|
||||
#define SDL_CursorVisible SDL_CursorVisible_REAL
|
||||
#define SDL_DXGIGetOutputInfo SDL_DXGIGetOutputInfo_REAL
|
||||
#define SDL_DateTimeToTime SDL_DateTimeToTime_REAL
|
||||
#define SDL_DelEventWatch SDL_DelEventWatch_REAL
|
||||
#define SDL_DelHintCallback SDL_DelHintCallback_REAL
|
||||
@@ -229,6 +224,7 @@
|
||||
#define SDL_GetCurrentTime SDL_GetCurrentTime_REAL
|
||||
#define SDL_GetCurrentVideoDriver SDL_GetCurrentVideoDriver_REAL
|
||||
#define SDL_GetCursor SDL_GetCursor_REAL
|
||||
#define SDL_GetDXGIOutputInfo SDL_GetDXGIOutputInfo_REAL
|
||||
#define SDL_GetDateTimeLocalePreferences SDL_GetDateTimeLocalePreferences_REAL
|
||||
#define SDL_GetDayOfWeek SDL_GetDayOfWeek_REAL
|
||||
#define SDL_GetDayOfYear SDL_GetDayOfYear_REAL
|
||||
@@ -691,6 +687,7 @@
|
||||
#define SDL_RenderTextureRotated SDL_RenderTextureRotated_REAL
|
||||
#define SDL_RenderViewportSet SDL_RenderViewportSet_REAL
|
||||
#define SDL_ReportAssertion SDL_ReportAssertion_REAL
|
||||
#define SDL_RequestAndroidPermission SDL_RequestAndroidPermission_REAL
|
||||
#define SDL_ResetAssertionReport SDL_ResetAssertionReport_REAL
|
||||
#define SDL_ResetHint SDL_ResetHint_REAL
|
||||
#define SDL_ResetHints SDL_ResetHints_REAL
|
||||
@@ -711,6 +708,8 @@
|
||||
#define SDL_ScreenKeyboardShown SDL_ScreenKeyboardShown_REAL
|
||||
#define SDL_ScreenSaverEnabled SDL_ScreenSaverEnabled_REAL
|
||||
#define SDL_SeekIO SDL_SeekIO_REAL
|
||||
#define SDL_SendAndroidBackButton SDL_SendAndroidBackButton_REAL
|
||||
#define SDL_SendAndroidMessage SDL_SendAndroidMessage_REAL
|
||||
#define SDL_SendGamepadEffect SDL_SendGamepadEffect_REAL
|
||||
#define SDL_SendJoystickEffect SDL_SendJoystickEffect_REAL
|
||||
#define SDL_SendJoystickVirtualSensorData SDL_SendJoystickVirtualSensorData_REAL
|
||||
@@ -817,6 +816,7 @@
|
||||
#define SDL_SetX11EventHook SDL_SetX11EventHook_REAL
|
||||
#define SDL_SetiOSAnimationCallback SDL_SetiOSAnimationCallback_REAL
|
||||
#define SDL_SetiOSEventPump SDL_SetiOSEventPump_REAL
|
||||
#define SDL_ShowAndroidToast SDL_ShowAndroidToast_REAL
|
||||
#define SDL_ShowCursor SDL_ShowCursor_REAL
|
||||
#define SDL_ShowMessageBox SDL_ShowMessageBox_REAL
|
||||
#define SDL_ShowOpenFileDialog SDL_ShowOpenFileDialog_REAL
|
||||
|
||||
@@ -57,10 +57,6 @@ SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimer,(Uint32 a, SDL_TimerCallback b, void *c
|
||||
SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimerNS,(Uint64 a, SDL_NSTimerCallback b, void *c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_AddVulkanRenderSemaphores,(SDL_Renderer *a, Uint32 b, Sint64 c, Sint64 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(void*,SDL_AllocateEventMemory,(size_t a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_AndroidBackButton,(void),(),)
|
||||
SDL_DYNAPI_PROC(int,SDL_AndroidRequestPermission,(const char *a, SDL_AndroidRequestPermissionCallback b, void *c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_AndroidSendMessage,(Uint32 a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_AndroidShowToast,(const char *a, int b, int c, int d, int e),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_AtomicAdd,(SDL_AtomicInt *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicCompareAndSwap,(SDL_AtomicInt *a, int b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicCompareAndSwapPointer,(void **a, void *b, void *c),(a,b,c),return)
|
||||
@@ -130,7 +126,6 @@ SDL_DYNAPI_PROC(SDL_Window*,SDL_CreateWindow,(const char *a, int b, int c, SDL_W
|
||||
SDL_DYNAPI_PROC(int,SDL_CreateWindowAndRenderer,(const char *a, int b, int c, SDL_WindowFlags d, SDL_Window **e, SDL_Renderer **f),(a,b,c,d,e,f),return)
|
||||
SDL_DYNAPI_PROC(SDL_Window*,SDL_CreateWindowWithProperties,(SDL_PropertiesID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_CursorVisible,(void),(),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_DXGIGetOutputInfo,(SDL_DisplayID a, int *b, int *c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_DateTimeToTime,(const SDL_DateTime *a, SDL_Time *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_DelEventWatch,(SDL_EventFilter a, void *b),(a,b),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DelHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),)
|
||||
@@ -249,6 +244,7 @@ SDL_DYNAPI_PROC(SDL_ThreadID,SDL_GetCurrentThreadID,(void),(),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetCurrentTime,(SDL_Time *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetCurrentVideoDriver,(void),(),return)
|
||||
SDL_DYNAPI_PROC(SDL_Cursor*,SDL_GetCursor,(void),(),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDXGIOutputInfo,(SDL_DisplayID a, int *b, int *c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDateTimeLocalePreferences,(SDL_DateFormat *a, SDL_TimeFormat *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDayOfWeek,(int a, int b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDayOfYear,(int a, int b, int c),(a,b,c),return)
|
||||
@@ -702,6 +698,7 @@ SDL_DYNAPI_PROC(int,SDL_RenderTexture,(SDL_Renderer *a, SDL_Texture *b, const SD
|
||||
SDL_DYNAPI_PROC(int,SDL_RenderTextureRotated,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, const SDL_FRect *d, const double e, const SDL_FPoint *f, const SDL_FlipMode g),(a,b,c,d,e,f,g),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_RenderViewportSet,(SDL_Renderer *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_AssertState,SDL_ReportAssertion,(SDL_AssertData *a, const char *b, const char *c, int d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_RequestAndroidPermission,(const char *a, SDL_RequestAndroidPermissionCallback b, void *c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_ResetAssertionReport,(void),(),)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_ResetHint,(const char *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_ResetHints,(void),(),)
|
||||
@@ -722,6 +719,8 @@ SDL_DYNAPI_PROC(int,SDL_SaveBMP_IO,(SDL_Surface *a, SDL_IOStream *b, SDL_bool c)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_ScreenKeyboardShown,(SDL_Window *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_ScreenSaverEnabled,(void),(),return)
|
||||
SDL_DYNAPI_PROC(Sint64,SDL_SeekIO,(SDL_IOStream *a, Sint64 b, SDL_IOWhence c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_SendAndroidBackButton,(void),(),)
|
||||
SDL_DYNAPI_PROC(int,SDL_SendAndroidMessage,(Uint32 a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SendGamepadEffect,(SDL_Gamepad *a, const void *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SendJoystickEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SendJoystickVirtualSensorData,(SDL_Joystick *a, SDL_SensorType b, Uint64 c, const float *d, int e),(a,b,c,d,e),return)
|
||||
@@ -827,6 +826,7 @@ SDL_DYNAPI_PROC(void,SDL_SetWindowsMessageHook,(SDL_WindowsMessageHook a, void *
|
||||
SDL_DYNAPI_PROC(void,SDL_SetX11EventHook,(SDL_X11EventHook a, void *b),(a,b),)
|
||||
SDL_DYNAPI_PROC(int,SDL_SetiOSAnimationCallback,(SDL_Window *a, int b, SDL_iOSAnimationCallback c, void *d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_SetiOSEventPump,(SDL_bool a),(a),)
|
||||
SDL_DYNAPI_PROC(int,SDL_ShowAndroidToast,(const char *a, int b, int c, int d, int e),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_ShowCursor,(void),(),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_ShowMessageBox,(const SDL_MessageBoxData *a, int *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_ShowOpenFileDialog,(SDL_DialogFileCallback a, void *b, SDL_Window *c, const SDL_DialogFileFilter *d, int e, const char *f, SDL_bool g),(a,b,c,d,e,f,g),)
|
||||
|
||||
@@ -46,7 +46,7 @@ typedef struct XUserHandle XUserHandle;
|
||||
#endif
|
||||
|
||||
#ifndef SDL_PLATFORM_ANDROID
|
||||
typedef void *SDL_AndroidRequestPermissionCallback;
|
||||
typedef void *SDL_RequestAndroidPermissionCallback;
|
||||
#endif
|
||||
|
||||
#ifndef SDL_PLATFORM_IOS
|
||||
|
||||
@@ -1030,7 +1030,7 @@ extern "C"
|
||||
{
|
||||
|
||||
// !!! FIXME: make this non-blocking!
|
||||
static void SDLCALL AndroidRequestPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
{
|
||||
SDL_AtomicSet((SDL_AtomicInt *) userdata, granted ? 1 : -1);
|
||||
}
|
||||
@@ -1040,7 +1040,7 @@ static SDL_bool RequestBluetoothPermissions(const char *permission)
|
||||
// !!! FIXME: make this non-blocking!
|
||||
SDL_AtomicInt permission_response;
|
||||
SDL_AtomicSet(&permission_response, 0);
|
||||
if (SDL_AndroidRequestPermission(permission, AndroidRequestPermissionBlockingCallback, &permission_response) == -1) {
|
||||
if (SDL_RequestAndroidPermission(permission, RequestAndroidPermissionBlockingCallback, &permission_response) == -1) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1266,7 +1266,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
SDL_Log("D3D9 Adapter Index: %d", adapterIndex);
|
||||
|
||||
/* Print the DXGI adapter and output indices */
|
||||
SDL_DXGIGetOutputInfo(displayID, &adapterIndex, &outputIndex);
|
||||
SDL_GetDXGIOutputInfo(displayID, &adapterIndex, &outputIndex);
|
||||
SDL_Log("DXGI Adapter Index: %d Output Index: %d", adapterIndex, outputIndex);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -42,14 +42,13 @@ void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata)
|
||||
|
||||
#endif /* SDL_PLATFORM_WIN32 || SDL_PLATFORM_GDK */
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
|
||||
SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex)
|
||||
SDL_DECLSPEC int SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
|
||||
SDL_bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex)
|
||||
{
|
||||
(void)displayID;
|
||||
(void)adapterIndex;
|
||||
(void)outputIndex;
|
||||
SDL_Unsupported();
|
||||
return SDL_FALSE;
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID);
|
||||
|
||||
@@ -629,7 +629,7 @@ int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID)
|
||||
}
|
||||
#endif /* !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) */
|
||||
|
||||
SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex)
|
||||
int SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex)
|
||||
{
|
||||
#ifndef HAVE_DXGI_H
|
||||
if (adapterIndex) {
|
||||
@@ -638,8 +638,7 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *
|
||||
if (outputIndex) {
|
||||
*outputIndex = -1;
|
||||
}
|
||||
SDL_SetError("SDL was compiled without DXGI support due to missing dxgi.h header");
|
||||
return SDL_FALSE;
|
||||
return SDL_SetError("SDL was compiled without DXGI support due to missing dxgi.h header");
|
||||
#else
|
||||
const SDL_VideoDevice *videodevice = SDL_GetVideoDevice();
|
||||
const SDL_VideoData *videodata = videodevice ? videodevice->driverdata : NULL;
|
||||
@@ -649,26 +648,22 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *
|
||||
IDXGIOutput *pDXGIOutput;
|
||||
|
||||
if (!adapterIndex) {
|
||||
SDL_InvalidParamError("adapterIndex");
|
||||
return SDL_FALSE;
|
||||
return SDL_InvalidParamError("adapterIndex");
|
||||
}
|
||||
|
||||
if (!outputIndex) {
|
||||
SDL_InvalidParamError("outputIndex");
|
||||
return SDL_FALSE;
|
||||
return SDL_InvalidParamError("outputIndex");
|
||||
}
|
||||
|
||||
*adapterIndex = -1;
|
||||
*outputIndex = -1;
|
||||
|
||||
if (!pData) {
|
||||
SDL_SetError("Invalid display index");
|
||||
return SDL_FALSE;
|
||||
return SDL_SetError("Invalid display index");
|
||||
}
|
||||
|
||||
if (!videodata || !videodata->pDXGIFactory) {
|
||||
SDL_SetError("Unable to create DXGI interface");
|
||||
return SDL_FALSE;
|
||||
return SDL_SetError("Unable to create DXGI interface");
|
||||
}
|
||||
|
||||
nAdapter = 0;
|
||||
@@ -690,10 +685,9 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *
|
||||
}
|
||||
|
||||
if (*adapterIndex == -1) {
|
||||
return SDL_FALSE;
|
||||
} else {
|
||||
return SDL_TRUE;
|
||||
return SDL_SetError("Couldn't find matching adapter");
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user