sdl2-compat: Update for SysWM properties

From d81aac9a3ed3d366c8c9ae5c2d5baee05cd847be Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Wed, 8 Nov 2023 22:02:13 -0500
Subject: [PATCH] Update for SysWM properties

---
 src/sdl2_compat.c          | 200 +++++++++++++++++--------------------
 src/sdl2_compat.h          | 119 ++++++++++------------
 src/sdl3_include_wrapper.h |  41 ++++----
 src/sdl3_syms.h            |  11 +-
 4 files changed, 164 insertions(+), 207 deletions(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 05630ab..572229d 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -2491,63 +2491,51 @@ SDL_GetTicks64(void)
     return SDL3_GetTicks();
 }
 
-static SDL_bool
-SysWMInfo3to2(SDL_SysWMinfo *wminfo3, SDL2_SysWMinfo *wminfo2)
-{
-    switch (wminfo3->subsystem) {
-#if defined(SDL_ENABLE_SYSWM_ANDROID)
-    case SDL_SYSWM_ANDROID:
-        wminfo2->subsystem = SDL2_SYSWM_ANDROID;
-        wminfo2->info.android.window = wminfo3->info.android.window;
-        wminfo2->info.android.surface = wminfo3->info.android.surface;
-        break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_COCOA)
-    case SDL_SYSWM_COCOA:
-        wminfo2->subsystem = SDL2_SYSWM_COCOA;
-        wminfo2->info.cocoa.window = wminfo3->info.cocoa.window;
-        break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_DIRECTFB)
-    case SDL_SYSWM_DIRECTFB:
-        wminfo2->info.dfb.dfb = wminfo3->info.dfb.dfb;
-        wminfo2->info.dfb.window = wminfo3->info.dfb.window;
-        wminfo2->info.dfb.surface = wminfo3->info.dfb.surface;
-        break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_KMSDRM)
-    case SDL_SYSWM_KMSDRM:
-        wminfo2->subsystem = SDL2_SYSWM_KMSDRM;
-        wminfo2->info.kmsdrm.dev_index = wminfo3->info.kmsdrm.dev_index;
-        wminfo2->info.kmsdrm.drm_fd = wminfo3->info.kmsdrm.drm_fd;
-        wminfo2->info.kmsdrm.gbm_dev = wminfo3->info.kmsdrm.gbm_dev;
-        break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_OS2)
-    case SDL_SYSWM_OS2:
-        wminfo2->subsystem = SDL2_SYSWM_OS2;
-        wminfo2->info.os2.hwnd = wminfo3->info.os2.hwnd;
-        wminfo2->info.os2.hwndFrame = wminfo3->info.os2.hwndFrame;
-        break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_UIKIT)
-    case SDL_SYSWM_COCOA:
-        wminfo2->subsystem = SDL2_SYSWM_UIKIT;
-        wminfo2->info.uikit.window = wminfo3->info.uikit.window;
-        break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_VIVANTE)
-    case SDL_SYSWM_VIVANTE:
-        wminfo2->subsystem = SDL2_SYSWM_VIVANTE;
-        wminfo2->info.vivante.display = wminfo3->info.vivante.display;
-        wminfo2->info.vivante.window = wminfo3->info.vivante.window;
-        break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_WAYLAND)
-    case SDL_SYSWM_WAYLAND: {
-        Uint32 version2 = SDL_VERSIONNUM((Uint32)wminfo2->version.major,
-                                         (Uint32)wminfo2->version.minor,
-                                         (Uint32)wminfo2->version.patch);
+DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window *window, SDL_SysWMinfo *info)
+{
+    const char *driver = SDL3_GetCurrentVideoDriver();
+    SDL_PropertiesID props;
+
+    if (!driver) {
+        return SDL_FALSE;
+    }
+    if (!window) {
+        SDL3_InvalidParamError("window");
+        return SDL_FALSE;
+    }
+    if (!info) {
+        SDL3_InvalidParamError("info");
+        return SDL_FALSE;
+    }
+
+    props = SDL3_GetWindowProperties(window);
+
+    if (SDL_strcmp(driver, "Android") == 0) {
+        info->subsystem = SDL2_SYSWM_ANDROID;
+        info->info.android.window = SDL3_GetProperty(props, "SDL.window.android.window");
+        info->info.android.surface = SDL3_GetProperty(props, "SDL.window.android.surface");
+    } else if (SDL_strcmp(driver, "cocoa") == 0) {
+        info->subsystem = SDL2_SYSWM_COCOA;
+        info->info.cocoa.window = (NSWindow *)SDL3_GetProperty(props, "SDL.window.cocoa.window");
+    } else if (SDL_strcmp(driver, "kmsdrm") == 0) {
+        info->subsystem = SDL2_SYSWM_KMSDRM;
+        info->info.kmsdrm.dev_index = (int)(intptr_t)SDL3_GetProperty(props, "SDL.window.kmsdrm.dev_index");
+        info->info.kmsdrm.drm_fd = (int)(intptr_t)SDL3_GetProperty(props, "SDL.window.kmsdrm.drm_fd");
+        info->info.kmsdrm.gbm_dev = SDL3_GetProperty(props, "SDL.window.kmsdrm.gbm_dev");
+    } else if (SDL_strcmp(driver, "uikit") == 0) {
+        info->subsystem = SDL2_SYSWM_UIKIT;
+        info->info.uikit.window = (UIWindow *)SDL3_GetProperty(props, "SDL.window.uikit.window");
+        info->info.uikit.colorbuffer = 0;
+        info->info.uikit.framebuffer = 0;
+        info->info.uikit.resolveFramebuffer = 0;
+    } else if (SDL_strcmp(driver, "vivante") == 0) {
+        info->subsystem = SDL2_SYSWM_VIVANTE;
+        info->info.vivante.display = SDL3_GetProperty(props, "SDL.window.vivante.display");
+        info->info.vivante.window = SDL3_GetProperty(props, "SDL.window.vivante.window");
+    } else if (SDL_strcmp(driver, "wayland") == 0) {
+        Uint32 version2 = SDL_VERSIONNUM((Uint32)info->version.major,
+                                         (Uint32)info->version.minor,
+                                         (Uint32)info->version.patch);
 
         /* Before 2.0.6, it was possible to build an SDL with Wayland support
          * (SDL_SysWMinfo will be large enough to hold Wayland info), but build
@@ -2561,72 +2549,48 @@ SysWMInfo3to2(SDL_SysWMinfo *wminfo3, SDL2_SysWMinfo *wminfo2)
          * maybe by forcing SDL_VIDEODRIVER=x11.
          */
         if (version2 < SDL_VERSIONNUM(2, 0, 6)) {
-            wminfo2->subsystem = SDL2_SYSWM_UNKNOWN;
-            SDL_SetError("Version must be 2.0.6 or newer");
+            info->subsystem = SDL2_SYSWM_UNKNOWN;
+            SDL3_SetError("Version must be 2.0.6 or newer");
             return SDL_FALSE;
         }
 
-        wminfo2->subsystem = SDL2_SYSWM_WAYLAND;
-        wminfo2->info.wl.display = wminfo3->info.wl.display;
-        wminfo2->info.wl.surface = wminfo3->info.wl.surface;
-        wminfo2->info.wl.shell_surface = NULL; /* Deprecated */
+        info->subsystem = SDL2_SYSWM_WAYLAND;
+        info->info.wl.display = SDL3_GetProperty(props, "SDL.window.wayland.display");
+        info->info.wl.surface = SDL3_GetProperty(props, "SDL.window.wayland.surface");
+        info->info.wl.shell_surface = NULL; /* Deprecated */
 
         if (version2 >= SDL_VERSIONNUM(2, 0, 15)) {
-            wminfo2->info.wl.egl_window = wminfo3->info.wl.egl_window;
-            wminfo2->info.wl.xdg_surface = wminfo3->info.wl.xdg_surface;
+            info->info.wl.egl_window = SDL3_GetProperty(props, "SDL.window.wayland.egl_window");
+            info->info.wl.xdg_surface = SDL3_GetProperty(props, "SDL.window.wayland.xdg_surface");
             if (version2 >= SDL_VERSIONNUM(2, 0, 17)) {
-                wminfo2->info.wl.xdg_toplevel = wminfo3->info.wl.xdg_toplevel;
+                info->info.wl.xdg_toplevel = SDL3_GetProperty(props, "SDL.window.wayland.xdg_toplevel");
                 if (version2 >= SDL_VERSIONNUM(2, 0, 22)) {
-                    wminfo2->info.wl.xdg_popup = wminfo3->info.wl.xdg_popup;
-                    wminfo2->info.wl.xdg_positioner =
-                        wminfo3->info.wl.xdg_positioner;
+                    info->info.wl.xdg_popup = SDL3_GetProperty(props, "SDL.window.wayland.xdg_popup");
+                    info->info.wl.xdg_positioner = SDL3_GetProperty(props, "SDL.window.wayland.xdg_positioner");
                 }
             }
         }
-    } break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_WINDOWS)
-    case SDL_SYSWM_WINDOWS:
-        wminfo2->subsystem = SDL2_SYSWM_WINDOWS;
-        wminfo2->info.win.window = wminfo3->info.win.window;
-        wminfo2->info.win.hdc = wminfo3->info.win.hdc;
-        wminfo2->info.win.hinstance = wminfo3->info.win.hinstance;
-        break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_WINRT)
-    case SDL_SYSWM_WINRT:
-        wminfo2->subsystem = SDL2_SYSWM_WINRT;
-        wminfo2->info.winrt.window = wminfo3->info.winrt.window;
-        break;
-#endif
-#if defined(SDL_ENABLE_SYSWM_X11)
-    case SDL_SYSWM_X11:
-        wminfo2->subsystem = SDL2_SYSWM_X11;
-        wminfo2->info.x11.display = wminfo3->info.x11.display;
-        wminfo2->info.x11.window = wminfo3->info.x11.window;
-        break;
-#endif
-    default:
-        wminfo2->subsystem = SDL2_SYSWM_UNKNOWN;
+    } else if (SDL_strcmp(driver, "windows") == 0) {
+        info->subsystem = SDL2_SYSWM_WINDOWS;
+        info->info.win.window = SDL3_GetProperty(props, "SDL.window.win32.hwnd");
+        info->info.win.hdc = SDL3_GetProperty(props, "SDL.window.win32.hdc");
+        info->info.win.hinstance = SDL3_GetProperty(props, "SDL.window.win32.hinstance");
+    } else if (SDL_strcmp(driver, "winrt") == 0) {
+        info->subsystem = SDL2_SYSWM_WINRT;
+        info->info.winrt.window = SDL3_GetProperty(props, "SDL.window.winrt.window");
+    } else if (SDL_strcmp(driver, "x11") == 0) {
+        info->subsystem = SDL2_SYSWM_X11;
+        info->info.x11.display = SDL3_GetProperty(props, "SDL.window.x11.display");
+        info->info.x11.window = (unsigned long)(uintptr_t)SDL3_GetProperty(props, "SDL.window.x11.window");
+    } else {
+        SDL3_SetError("Video driver '%s' has no mapping to SDL_SysWMinfo", driver);
+        info->subsystem = SDL2_SYSWM_UNKNOWN;
         return SDL_FALSE;
     }
 
     return SDL_TRUE;
 }
 
-DECLSPEC SDL_bool SDLCALL
-SDL_GetWindowWMInfo(SDL_Window *window, SDL_SysWMinfo *wminfo)
-{
-    SDL_SysWMinfo wminfo3;
-    SDL3_zero(wminfo3);
-
-    if (SDL3_GetWindowWMInfo(window, &wminfo3, SDL_VERSIONNUM(3, 0, 0)) == 0) {
-        return SysWMInfo3to2(&wminfo3, (SDL2_SysWMinfo*)wminfo);
-    }
-
-    return SDL_FALSE;
-}
-
 /* this API was removed from SDL3 since nothing supported it. Just report 0. */
 DECLSPEC int SDLCALL
 SDL_JoystickNumBalls(SDL_Joystick *joystick)
@@ -5406,14 +5370,14 @@ SDL_SetWindowData(SDL_Window * window, const char *name, void *userdata)
     }
 
     prev = SDL_GetWindowData(window, name);
-    SDL3_SetProperty(SDL3_GetWindowProperties(window), name, userdata, NULL, NULL);
+    SDL3_SetProperty(SDL3_GetWindowProperties(window), name, userdata);
     return prev;
 }
 
 DECLSPEC int SDLCALL
 SDL_SetTextureUserData(SDL_Texture * texture, void *userdata)
 {
-    return SDL3_SetProperty(SDL3_GetTextureProperties(texture), "userdata", userdata, NULL, NULL);
+    return SDL3_SetProperty(SDL3_GetTextureProperties(texture), "userdata", userdata);
 }
 
 DECLSPEC void * SDLCALL
@@ -6696,6 +6660,24 @@ SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex)
 {
     return SDL3_DXGIGetOutputInfo((SDL_DisplayID)displayIndex, adapterIndex, outputIndex);
 }
+
+DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer *renderer)
+{
+    return (IDirect3DDevice9 *)SDL3_GetProperty(SDL3_GetRendererProperties(renderer),
+                                                "SDL.renderer.d3d9.device");
+}
+
+DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer *renderer)
+{
+    return (ID3D11Device *)SDL3_GetProperty(SDL3_GetRendererProperties(renderer),
+                                            "SDL.renderer.d3d11.device");
+}
+
+DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer *renderer)
+{
+    return (ID3D12Device *)SDL3_GetProperty(SDL3_GetRendererProperties(renderer),
+                                            "SDL.renderer.d3d12.device");
+}
 #endif
 
 #ifdef __WINRT__
diff --git a/src/sdl2_compat.h b/src/sdl2_compat.h
index 6259442..69f5bf1 100644
--- a/src/sdl2_compat.h
+++ b/src/sdl2_compat.h
@@ -175,6 +175,14 @@ typedef struct SDL2_AudioStream
 #define SDL2_AUDIO_ALLOW_SAMPLES_CHANGE      0x00000008
 #define SDL2_AUDIO_ALLOW_ANY_CHANGE          (SDL2_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL2_AUDIO_ALLOW_FORMAT_CHANGE|SDL2_AUDIO_ALLOW_CHANNELS_CHANGE|SDL2_AUDIO_ALLOW_SAMPLES_CHANGE)
 
+/* Prototypes for D3D devices */
+#if defined(__WIN32__) || defined(__WINGDK__)
+typedef struct IDirect3DDevice9 IDirect3DDevice9;
+typedef struct ID3D11Device ID3D11Device;
+typedef struct ID3D12Device ID3D12Device;
+#endif
+
+/* SDL2 SysWM mapping */
 typedef enum
 {
   SDL2_SYSWM_UNKNOWN,
@@ -194,118 +202,93 @@ typedef enum
   SDL2_SYSWM_RISCOS
 } SDL2_SYSWM_TYPE;
 
-struct SDL2_SysWMinfo
+#ifdef __OBJC__
+@class NSWindow;
+@class UIWindow;
+#else
+typedef struct _NSWindow NSWindow;
+typedef struct _UIWindow UIWindow;
+#endif
+
+struct SDL_SysWMinfo
 {
     SDL_version version;
     SDL2_SYSWM_TYPE subsystem;
     union
     {
-#if defined(SDL_ENABLE_SYSWM_WINDOWS)
       struct
       {
-        HWND window;                /**< The window handle */
-        HDC hdc;                    /**< The window device context */
-        HINSTANCE hinstance;        /**< The instance handle */
+        void *window;
+        void *hdc;
+        void *hinstance;
       } win;
-#endif
-#if defined(SDL_ENABLE_SYSWM_WINRT)
+
       struct
       {
-        IInspectable * window;      /**< The WinRT CoreWindow */
+        void *window;
       } winrt;
-#endif
-#if defined(SDL_ENABLE_SYSWM_X11)
+
       struct
       {
-        Display *display;           /**< The X11 display */
-        Window window;              /**< The X11 window */
+        void *display;
+        unsigned long window;
       } x11;
-#endif
-#if defined(SDL_ENABLE_SYSWM_DIRECTFB)
-      struct
-      {
-        IDirectFB *dfb;             /**< The directfb main interface */
-        IDirectFBWindow *window;    /**< The directfb window handle */
-        IDirectFBSurface *surface;  /**< The directfb client surface */
-      } dfb;
-#endif
-#if defined(SDL_ENABLE_SYSWM_COCOA)
+
       struct
       {
 #if defined(__OBJC__) && defined(__has_feature)
 #if __has_feature(objc_arc)
-        NSWindow __unsafe_unretained *window; /**< The Cocoa window */
-#else
-        NSWindow *window;                     /**< The Cocoa window */
+        NSWindow __unsafe_unretained *window;
 #endif
 #else
-        NSWindow *window;                     /**< The Cocoa window */
+        NSWindow *window;
 #endif
       } cocoa;
-#endif
-#if defined(SDL_ENABLE_SYSWM_UIKIT)
+
       struct
       {
 #if defined(__OBJC__) && defined(__has_feature)
 #if __has_feature(objc_arc)
-        UIWindow __unsafe_unretained *window; /**< The UIKit window */
-#else
-        UIWindow *window;                     /**< The UIKit window */
+        UIWindow __unsafe_unretained *window;
 #endif
 #else
-        UIWindow *window;                     /**< The UIKit window */
+        UIWindow *window;
 #endif
-        GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */
-        GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */
-        GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
+        Uint32 framebuffer;
+        Uint32 colorbuffer;
+        Uint32 resolveFramebuffer;
       } uikit;
-#endif
-#if defined(SDL_ENABLE_SYSWM_WAYLAND)
+
       struct
       {
-        struct wl_display *display;             /**< Wayland display */
-        struct wl_surface *surface;             /**< Wayland surface */
-        void *shell_surface;                    /**< DEPRECATED Wayland shell_surface (window manager handle) */
-        struct wl_egl_window *egl_window;       /**< Wayland EGL window (native window) */
-        struct xdg_surface *xdg_surface;        /**< Wayland xdg surface (window manager handle) */
-        struct xdg_toplevel *xdg_toplevel;      /**< Wayland xdg toplevel role */
-        struct xdg_popup *xdg_popup;            /**< Wayland xdg popup role */
-        struct xdg_positioner *xdg_positioner;  /**< Wayland xdg positioner, for popup */
+        void *display;
+        void *surface;
+        void *shell_surface;
+        void *egl_window;
+        void *xdg_surface;
+        void *xdg_toplevel;
+        void *xdg_popup;
+        void *xdg_positioner;
       } wl;
-#endif
 
-#if defined(SDL_ENABLE_SYSWM_ANDROID)
       struct
       {
-        ANativeWindow *window;
-        EGLSurface surface;
+        void *window;
+        void *surface;
       } android;
-#endif
 
-#if defined(SDL_ENABLE_SYSWM_OS2)
       struct
       {
-        HWND hwnd;                  /**< The window handle */
-        HWND hwndFrame;             /**< The frame window handle */
-      } os2;
-#endif
-
-#if defined(SDL_ENABLE_SYSWM_VIVANTE)
-      struct
-      {
-        EGLNativeDisplayType display;
-        EGLNativeWindowType window;
+        void *display;
+        void *window;
       } vivante;
-#endif
 
-#if defined(SDL_ENABLE_SYSWM_KMSDRM)
       struct
       {
-        int dev_index;               /**< Device index (ex: the X in /dev/dri/cardX) */
-        int drm_fd;                  /**< DRM FD (unavailable on Vulkan windows) */
-        struct gbm_device *gbm_dev;  /**< GBM device (unavailable on Vulkan windows) */
+        int dev_index;
+        int drm_fd;
+        void *gbm_dev;
       } kmsdrm;
-#endif
 
       /* Make sure this union is always 64 bytes (8 64-bit pointers). */
       /* Be careful not to overflow this if you add a new target! */
@@ -313,6 +296,6 @@ struct SDL2_SysWMinfo
     } info;
 };
 
-typedef struct SDL2_SysWMinfo SDL2_SysWMinfo;
+typedef struct SDL_SysWMinfo SDL_SysWMinfo;
 
 #endif /* sdl2_compat_h */
diff --git a/src/sdl3_include_wrapper.h b/src/sdl3_include_wrapper.h
index 98e715d..c034d7e 100644
--- a/src/sdl3_include_wrapper.h
+++ b/src/sdl3_include_wrapper.h
@@ -312,8 +312,6 @@
 #define SDL_GetRelativeMouseMode IGNORE_THIS_VERSION_OF_SDL_GetRelativeMouseMode
 #define SDL_GetRelativeMouseState IGNORE_THIS_VERSION_OF_SDL_GetRelativeMouseState
 #define SDL_GetRenderClipRect IGNORE_THIS_VERSION_OF_SDL_GetRenderClipRect
-#define SDL_GetRenderD3D11Device IGNORE_THIS_VERSION_OF_SDL_GetRenderD3D11Device
-#define SDL_GetRenderD3D9Device IGNORE_THIS_VERSION_OF_SDL_GetRenderD3D9Device
 #define SDL_GetRenderDrawBlendMode IGNORE_THIS_VERSION_OF_SDL_GetRenderDrawBlendMode
 #define SDL_GetRenderDrawColor IGNORE_THIS_VERSION_OF_SDL_GetRenderDrawColor
 #define SDL_GetRenderDriver IGNORE_THIS_VERSION_OF_SDL_GetRenderDriver
@@ -388,7 +386,6 @@
 #define SDL_GetWindowSizeInPixels IGNORE_THIS_VERSION_OF_SDL_GetWindowSizeInPixels
 #define SDL_GetWindowSurface IGNORE_THIS_VERSION_OF_SDL_GetWindowSurface
 #define SDL_GetWindowTitle IGNORE_THIS_VERSION_OF_SDL_GetWindowTitle
-#define SDL_GetWindowWMInfo IGNORE_THIS_VERSION_OF_SDL_GetWindowWMInfo
 #define SDL_GetYUVConversionMode IGNORE_THIS_VERSION_OF_SDL_GetYUVConversionMode
 #define SDL_GetYUVConversionModeForResolution IGNORE_THIS_VERSION_OF_SDL_GetYUVConversionModeForResolution
 #define SDL_HapticClose IGNORE_THIS_VERSION_OF_SDL_HapticClose
@@ -548,7 +545,6 @@
 #define SDL_RenderFlush IGNORE_THIS_VERSION_OF_SDL_RenderFlush
 #define SDL_RenderGeometry IGNORE_THIS_VERSION_OF_SDL_RenderGeometry
 #define SDL_RenderGeometryRaw IGNORE_THIS_VERSION_OF_SDL_RenderGeometryRaw
-#define SDL_RenderGetD3D12Device IGNORE_THIS_VERSION_OF_SDL_RenderGetD3D12Device
 #define SDL_RenderLine IGNORE_THIS_VERSION_OF_SDL_RenderLine
 #define SDL_RenderLines IGNORE_THIS_VERSION_OF_SDL_RenderLines
 #define SDL_RenderPoint IGNORE_THIS_VERSION_OF_SDL_RenderPoint
@@ -948,6 +944,10 @@
 #define SDL_RWprintf IGNORE_THIS_VERSION_OF_SDL_RWprintf
 #define SDL_RWvprintf IGNORE_THIS_VERSION_OF_SDL_RWvprintf
 #define SDL_AllocateEventMemory IGNORE_THIS_VERSION_OF_SDL_AllocateEventMemory
+#define SDL_GetDisplayProperties IGNORE_THIS_VERSION_OF_SDL_GetDisplayProperties
+#define SDL_SetPropertyWithCleanup IGNORE_THIS_VERSION_OF_SDL_SetPropertyWithCleanup
+#define SDL_SetX11EventHook IGNORE_THIS_VERSION_OF_SDL_SetX11EventHook
+#define SDL_GetGlobalProperties IGNORE_THIS_VERSION_OF_SDL_GetGlobalProperties
 
 
 #define SDL_FUNCTION_POINTER_IS_VOID_POINTER 1
@@ -961,7 +961,6 @@
 
 #define SDL_MAIN_HANDLED 1
 #include <SDL3/SDL_main.h>
-#include <SDL3/SDL_syswm.h>
 #include <SDL3/SDL_vulkan.h>
 
 #ifdef _WIN32
@@ -2113,14 +2112,6 @@
 #undef SDL_GetRenderClipRect
 #endif
 
-#ifdef SDL_GetRenderD3D11Device
-#undef SDL_GetRenderD3D11Device
-#endif
-
-#ifdef SDL_GetRenderD3D9Device
-#undef SDL_GetRenderD3D9Device
-#endif
-
 #ifdef SDL_GetRenderDrawBlendMode
 #undef SDL_GetRenderDrawBlendMode
 #endif
@@ -2417,10 +2408,6 @@
 #undef SDL_GetWindowTitle
 #endif
 
-#ifdef SDL_GetWindowWMInfo
-#undef SDL_GetWindowWMInfo
-#endif
-
 #ifdef SDL_GetYUVConversionMode
 #undef SDL_GetYUVConversionMode
 #endif
@@ -3057,10 +3044,6 @@
 #undef SDL_RenderGeometryRaw
 #endif
 
-#ifdef SDL_RenderGetD3D12Device
-#undef SDL_RenderGetD3D12Device
-#endif
-
 #ifdef SDL_RenderLine
 #undef SDL_RenderLine
 #endif
@@ -4657,6 +4640,22 @@
 #undef SDL_AllocateEventMemory
 #endif
 
+#ifdef SDL_GetDisplayProperties
+#undef SDL_GetDisplayProperties
+#endif
+
+#ifdef SDL_SetPropertyWithCleanup
+#undef SDL_SetPropertyWithCleanup
+#endif
+
+#ifdef SDL_SetX11EventHook
+#undef SDL_SetX11EventHook
+#endif
+
+#ifdef SDL_GetGlobalProperties
+#undef SDL_GetGlobalProperties
+#endif
+
 /* undefine these macros too: */
 /* redefine as SDL3_xxx, if needed. */
 
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index b198d65..1314b0d 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -62,7 +62,6 @@ SDL3_SYM_PASSTHROUGH(void,UnregisterApp,(void),(),)
 
 #if defined(__WIN32__) || defined(__WINGDK__)
 SDL3_SYM(int,Direct3D9GetAdapterIndex,(SDL_DisplayID a),(a),return)
-SDL3_SYM_RENAMED(IDirect3DDevice9*,RenderGetD3D9Device,GetRenderD3D9Device,(SDL_Renderer *a),(a),return)
 #endif
 
 #ifdef __IOS__
@@ -418,7 +417,6 @@ SDL3_SYM(int,BlitSurfaceUnchecked,(SDL_Surface *a, const SDL_Rect *b, SDL_Surfac
 SDL3_SYM_PASSTHROUGH(int,SoftStretch,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return)
 SDL3_SYM_RENAMED(int,UpperBlitScaled,BlitSurfaceScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, SDL_Rect *d),(a,b,c,d),return)
 SDL3_SYM(int,BlitSurfaceUncheckedScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return)
-SDL3_SYM(int,GetWindowWMInfo,(SDL_Window *a, SDL_SysWMinfo *b, Uint32 c),(a,b,c),return)
 SDL3_SYM_PASSTHROUGH(const char*,GetThreadName,(SDL_Thread *a),(a),return)
 SDL3_SYM_PASSTHROUGH(SDL_threadID,ThreadID,(void),(),return)
 SDL3_SYM_PASSTHROUGH(SDL_threadID,GetThreadID,(SDL_Thread *a),(a),return)
@@ -714,9 +712,6 @@ SDL3_SYM_PASSTHROUGH(float,roundf,(float a),(a),return)
 SDL3_SYM_PASSTHROUGH(long,lround,(double a),(a),return)
 SDL3_SYM_PASSTHROUGH(long,lroundf,(float a),(a),return)
 SDL3_SYM_PASSTHROUGH(int,SoftStretchLinear,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return)
-#if defined(__WIN32__) || defined(__WINGDK__)
-SDL3_SYM_RENAMED(ID3D11Device*,RenderGetD3D11Device,GetRenderD3D11Device,(SDL_Renderer *a),(a),return)
-#endif
 SDL3_SYM_PASSTHROUGH(int,UpdateNVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f),(a,b,c,d,e,f),return)
 SDL3_SYM(int,SetWindowKeyboardGrab,(SDL_Window *a, SDL_bool b),(a,b),return)
 SDL3_SYM(int,SetWindowMouseGrab,(SDL_Window *a, SDL_bool b),(a,b),return)
@@ -799,9 +794,6 @@ SDL3_SYM(int,GUIDToString,(SDL_GUID a, char *b, int c),(a,b,c),return)
 SDL3_SYM_PASSTHROUGH(SDL_GUID,GUIDFromString,(const char *a),(a),return)
 SDL3_SYM_PASSTHROUGH(SDL_bool,HasLSX,(void),(),return)
 SDL3_SYM_PASSTHROUGH(SDL_bool,HasLASX,(void),(),return)
-#if defined(__WIN32__) || defined(__GDK__)
-SDL3_SYM_PASSTHROUGH(ID3D12Device*,RenderGetD3D12Device,(SDL_Renderer *a),(a),return)
-#endif
 SDL3_SYM_PASSTHROUGH(size_t,utf8strnlen,(const char *a, size_t b),(a,b),return)
 
 #ifdef __GDK__
@@ -897,10 +889,11 @@ SDL3_SYM(SDL_GamepadBinding **,GetGamepadBindings,(SDL_Gamepad *a, int *b),(a,b)
 #ifdef __GDK__
 SDL3_SYM_PASSTHROUGH(int,GDKGetDefaultUser,(XUserHandle *a),(a),return)
 #endif
-SDL3_SYM(int,SetProperty,(SDL_PropertiesID a, const char *b, void *c, void (SDLCALL *d)(void *userdata, void *value), void *e),(a,b,c,d,e),return)
+SDL3_SYM(int,SetProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return)
 SDL3_SYM(void*,GetProperty,(SDL_PropertiesID a, const char *b),(a,b),return)
 SDL3_SYM(SDL_PropertiesID,GetWindowProperties,(SDL_Window *a),(a),return)
 SDL3_SYM(SDL_PropertiesID,GetTextureProperties,(SDL_Texture *a),(a),return)
+SDL3_SYM(SDL_PropertiesID,GetRendererProperties,(SDL_Renderer *a),(a),return)
 
 #undef SDL3_SYM
 #undef SDL3_SYM_PASSTHROUGH