From 08a0e42832a4a881a3746c4ad27caf07b32a03a4 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 1 Oct 2024 20:01:40 +0300
Subject: [PATCH] sync with latest SDL3 api changes
---
src/sdl2_compat.c | 6 ++++++
src/sdl3_include_wrapper.h | 17 +++++++++++------
src/sdl3_syms.h | 2 +-
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 989d5a1..a77092d 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -9559,6 +9559,12 @@ SDL_AndroidRequestPermission(const char *permission)
return (SDL3_GetAtomicInt(&response) < 0) ? SDL2_FALSE : SDL2_TRUE;
}
+
+SDL_DECLSPEC SDL2_bool SDLCALL
+SDL_IsAndroidTV(void)
+{
+ return SDL3_IsTV() ? SDL2_TRUE : SDL2_FALSE;
+}
#endif
#ifdef __cplusplus
diff --git a/src/sdl3_include_wrapper.h b/src/sdl3_include_wrapper.h
index 0d25df9..f2f3d08 100644
--- a/src/sdl3_include_wrapper.h
+++ b/src/sdl3_include_wrapper.h
@@ -626,7 +626,6 @@
#define SDL_InitHapticRumble IGNORE_THIS_VERSION_OF_SDL_InitHapticRumble
#define SDL_InitSubSystem IGNORE_THIS_VERSION_OF_SDL_InitSubSystem
#define SDL_InsertGPUDebugLabel IGNORE_THIS_VERSION_OF_SDL_InsertGPUDebugLabel
-#define SDL_IsAndroidTV IGNORE_THIS_VERSION_OF_SDL_IsAndroidTV
#define SDL_IsChromebook IGNORE_THIS_VERSION_OF_SDL_IsChromebook
#define SDL_IsDeXMode IGNORE_THIS_VERSION_OF_SDL_IsDeXMode
#define SDL_IsGamepad IGNORE_THIS_VERSION_OF_SDL_IsGamepad
@@ -634,6 +633,7 @@
#define SDL_IsJoystickVirtual IGNORE_THIS_VERSION_OF_SDL_IsJoystickVirtual
#define SDL_IsMouseHaptic IGNORE_THIS_VERSION_OF_SDL_IsMouseHaptic
#define SDL_IsTablet IGNORE_THIS_VERSION_OF_SDL_IsTablet
+#define SDL_IsTV IGNORE_THIS_VERSION_OF_SDL_IsTV
#define SDL_JoystickConnected IGNORE_THIS_VERSION_OF_SDL_JoystickConnected
#define SDL_JoystickEventsEnabled IGNORE_THIS_VERSION_OF_SDL_JoystickEventsEnabled
#define SDL_KillProcess IGNORE_THIS_VERSION_OF_SDL_KillProcess
@@ -1129,6 +1129,7 @@
#define SDL_memset4 IGNORE_THIS_VERSION_OF_SDL_memset4
#define SDL_modf IGNORE_THIS_VERSION_OF_SDL_modf
#define SDL_modff IGNORE_THIS_VERSION_OF_SDL_modff
+#define SDL_murmur3_32 IGNORE_THIS_VERSION_OF_SDL_murmur3_32
#define SDL_pow IGNORE_THIS_VERSION_OF_SDL_pow
#define SDL_powf IGNORE_THIS_VERSION_OF_SDL_powf
#define SDL_qsort IGNORE_THIS_VERSION_OF_SDL_qsort
@@ -1222,7 +1223,7 @@
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_vulkan.h>
-#ifdef _WIN32 /**/
+#if defined(_WIN32)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
@@ -3603,10 +3604,6 @@
#undef SDL_InsertGPUDebugLabel
#endif
-#ifdef SDL_IsAndroidTV
-#undef SDL_IsAndroidTV
-#endif
-
#ifdef SDL_IsChromebook
#undef SDL_IsChromebook
#endif
@@ -3635,6 +3632,10 @@
#undef SDL_IsTablet
#endif
+#ifdef SDL_IsTV
+#undef SDL_IsTV
+#endif
+
#ifdef SDL_JoystickConnected
#undef SDL_JoystickConnected
#endif
@@ -5615,6 +5616,10 @@
#undef SDL_modff
#endif
+#ifdef SDL_murmur3_32
+#undef SDL_murmur3_32
+#endif
+
#ifdef SDL_pow
#undef SDL_pow
#endif
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 580c73e..c30cc18 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -93,7 +93,6 @@ SDL3_SYM_RENAMED(const char*,AndroidGetInternalStoragePath,GetAndroidInternalSto
SDL3_SYM(Uint32,GetAndroidExternalStorageState,(void),(),return)
SDL3_SYM_RENAMED(const char*,AndroidGetExternalStoragePath,GetAndroidExternalStoragePath,(void),(),return)
SDL3_SYM_RENAMED_RETCODE(bool,AndroidSendMessage,SendAndroidMessage,(Uint32 a, int b),(a,b),return)
-SDL3_SYM_PASSTHROUGH_BOOL(bool,IsAndroidTV,(void),(),return)
SDL3_SYM_PASSTHROUGH_BOOL(bool,IsChromebook,(void),(),return)
SDL3_SYM_PASSTHROUGH_BOOL(bool,IsDeXMode,(void),(),return)
SDL3_SYM_RENAMED(void,AndroidBackButton,SendAndroidBackButton,(void),(),)
@@ -473,6 +472,7 @@ SDL3_SYM(bool,IsGamepad,(SDL_JoystickID a),(a),return)
SDL3_SYM(bool,IsJoystickVirtual,(SDL_JoystickID a),(a),return)
SDL3_SYM_RENAMED_BOOL(bool,IsScreenKeyboardShown,ScreenKeyboardShown,(SDL_Window *a),(a),return)
SDL3_SYM_RENAMED_BOOL(bool,IsScreenSaverEnabled,ScreenSaverEnabled,(void),(),return)
+SDL3_SYM(bool,IsTV,(void),(),return)
SDL3_SYM_PASSTHROUGH_BOOL(bool,IsTablet,(void),(),return)
SDL3_SYM_RENAMED(void,JoystickClose,CloseJoystick,(SDL_Joystick *a),(a),)
SDL3_SYM(bool,JoystickEventsEnabled,(void),(),return)