sdl2-compat: video: Updated for SDL3 SDL_GL_DeleteContext -> SDL_GL_DestroyContext change.

From a0b93afce3b1027629bfd4b41dc9ae355884a76b Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Wed, 10 Jul 2024 15:56:59 -0400
Subject: [PATCH] video: Updated for SDL3 SDL_GL_DeleteContext ->
 SDL_GL_DestroyContext change.

---
 src/sdl2_compat.c          | 3 ++-
 src/sdl3_include_wrapper.h | 6 +++---
 src/sdl3_syms.h            | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 753ad12..5a56314 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -7411,10 +7411,11 @@ SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed)
     SDL3_SetWindowMouseGrab(window, grabbed);
 }
 
+/* SDL3 added a return value and renamed this. We just throw the value away for SDL2. */
 SDL_DECLSPEC void SDLCALL
 SDL_GL_DeleteContext(SDL_GLContext context)
 {
-    SDL3_GL_DeleteContext(context);
+    (void) SDL3_GL_DestroyContext(context);
 }
 
 SDL_DECLSPEC void SDLCALL
diff --git a/src/sdl3_include_wrapper.h b/src/sdl3_include_wrapper.h
index 098e213..fb21e36 100644
--- a/src/sdl3_include_wrapper.h
+++ b/src/sdl3_include_wrapper.h
@@ -171,7 +171,7 @@
 #define SDL_GDKGetTaskQueue IGNORE_THIS_VERSION_OF_SDL_GDKGetTaskQueue
 #define SDL_GDKSuspendComplete IGNORE_THIS_VERSION_OF_SDL_GDKSuspendComplete
 #define SDL_GL_CreateContext IGNORE_THIS_VERSION_OF_SDL_GL_CreateContext
-#define SDL_GL_DeleteContext IGNORE_THIS_VERSION_OF_SDL_GL_DeleteContext
+#define SDL_GL_DestroyContext IGNORE_THIS_VERSION_OF_SDL_GL_DestroyContext
 #define SDL_GL_ExtensionSupported IGNORE_THIS_VERSION_OF_SDL_GL_ExtensionSupported
 #define SDL_GL_GetAttribute IGNORE_THIS_VERSION_OF_SDL_GL_GetAttribute
 #define SDL_GL_GetCurrentContext IGNORE_THIS_VERSION_OF_SDL_GL_GetCurrentContext
@@ -1649,8 +1649,8 @@
 #undef SDL_GL_CreateContext
 #endif
 
-#ifdef SDL_GL_DeleteContext
-#undef SDL_GL_DeleteContext
+#ifdef SDL_GL_DestroyContext
+#undef SDL_GL_DestroyContext
 #endif
 
 #ifdef SDL_GL_ExtensionSupported
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index d28d05e..55e26e5 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -502,7 +502,7 @@ SDL3_SYM_PASSTHROUGH(SDL_GLContext,GL_GetCurrentContext,(void),(),return)
 SDL3_SYM_PASSTHROUGH(int,GL_SetSwapInterval,(int a),(a),return)
 SDL3_SYM(int,GL_GetSwapInterval,(int *a),(a),return)
 SDL3_SYM(int,GL_SwapWindow,(SDL_Window *a),(a),return)
-SDL3_SYM(int,GL_DeleteContext,(SDL_GLContext a),(a),return)
+SDL3_SYM(int,GL_DestroyContext,(SDL_GLContext a),(a),return)
 SDL3_SYM_PASSTHROUGH(int,vsscanf,(const char *a, const char *b, va_list c),(a,b,c),return)
 SDL3_SYM(int,AddGamepadMappingsFromIO,(SDL_IOStream *a, SDL_bool b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(void,GL_ResetAttributes,(void),(),)