sdl2-compat: fix SDL_Direct3D9GetAdapterIndex, SDL_DXGIGetOutputInfo (displayID type)

From bbe06eff3f56828ce868c8ac5e8928a7d21a8cd2 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 6 Aug 2023 14:11:50 +0300
Subject: [PATCH] fix SDL_Direct3D9GetAdapterIndex, SDL_DXGIGetOutputInfo
 (displayID type)

---
 src/sdl2_compat.c | 13 +++++++++++++
 src/sdl3_syms.h   |  4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index f140c98..18cf5f9 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -6461,6 +6461,19 @@ SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id)
     return retval;
 }
 
+#if defined(__WIN32__) || defined(__WINGDK__)
+DECLSPEC int SDLCALL
+SDL_Direct3D9GetAdapterIndex(int displayIndex)
+{
+    return SDL3_Direct3D9GetAdapterIndex((SDL_DisplayID)displayIndex);
+}
+
+DECLSPEC SDL_bool SDLCALL
+SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex)
+{
+    return SDL3_DXGIGetOutputInfo((SDL_DisplayID)displayIndex, adapterIndex, outputIndex);
+}
+#endif
 
 #ifdef __WINRT__
 DECLSPEC int SDLCALL
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 6d2e27b..f3eee97 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -61,7 +61,7 @@ SDL3_SYM_PASSTHROUGH(void,UnregisterApp,(void),(),)
 #endif
 
 #if defined(__WIN32__) || defined(__WINGDK__)
-SDL3_SYM_PASSTHROUGH(int,Direct3D9GetAdapterIndex,(int a),(a),return)
+SDL3_SYM(int,Direct3D9GetAdapterIndex,(SDL_DisplayID a),(a),return)
 SDL3_SYM_RENAMED(IDirect3DDevice9*,RenderGetD3D9Device,GetRenderD3D9Device,(SDL_Renderer *a),(a),return)
 #endif
 
@@ -524,7 +524,7 @@ SDL3_SYM_PASSTHROUGH(SDL_bool,HasAVX,(void),(),return)
 SDL3_SYM_PASSTHROUGH(SDL_AssertionHandler,GetDefaultAssertionHandler,(void),(),return)
 SDL3_SYM_PASSTHROUGH(SDL_AssertionHandler,GetAssertionHandler,(void **a),(a),return)
 #if defined(__WIN32__) || defined(__WINGDK__)
-SDL3_SYM_PASSTHROUGH(SDL_bool,DXGIGetOutputInfo,(int a,int *b, int *c),(a,b,c),return)
+SDL3_SYM(SDL_bool,DXGIGetOutputInfo,(SDL_DisplayID a,int *b, int *c),(a,b,c),return)
 #endif
 SDL3_SYM_RENAMED(SDL_bool,RenderIsClipEnabled,RenderClipEnabled,(SDL_Renderer *a),(a),return)
 #ifdef __WINRT__