# sdl2-compat: implement SDL\_GL\_GetSwapInterval after SDL3 changes

**URL:** <https://discourse.libsdl.org/t/sdl2-compat-implement-sdl-gl-getswapinterval-after-sdl3-changes/41561>\
**Category:** SDL Commits\
**Created:** [January 4, 2023, 12:30pm UTC](https://discourse.libsdl.org/t/sdl2-compat-implement-sdl-gl-getswapinterval-after-sdl3-changes/41561 "2023-01-04T12:30:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [January 4, 2023, 12:30pm UTC](https://discourse.libsdl.org/t/sdl2-compat-implement-sdl-gl-getswapinterval-after-sdl3-changes/41561/1 "2023-01-04T12:30:02Z")

</div>

> <https://github.com/libsdl-org/sdl2-compat/commit/9b1be3c9e6e1600a58d9ecef06ad55fe5ab91dad>

```diff
From 9b1be3c9e6e1600a58d9ecef06ad55fe5ab91dad Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 4 Jan 2023 14:56:10 +0300
Subject: [PATCH] implement SDL_GL_GetSwapInterval after SDL3 changes

---
 src/sdl2_compat.c | 7 +++++++
 src/sdl3_syms.h | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 7288f82..b78cc5c 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -2841,6 +2841,13 @@ SDL_VideoQuit(void)
     SDL_QuitSubSystem(SDL_INIT_VIDEO);
 }
 
+DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void)
+{
+ int val = 0;
+ SDL3_GL_GetSwapInterval(&val);
+ return val;
+}
+
 DECLSPEC void SDLCALL 
 SDL_LockJoysticks(void)
 {
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 8e3eb37..0506514 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -547,7 +547,7 @@ SDL3_SYM_PASSTHROUGH(SDL_Window*,GL_GetCurrentWindow,(void),(),return)
 SDL3_SYM_PASSTHROUGH(SDL_GLContext,GL_GetCurrentContext,(void),(),return)
 SDL3_SYM_PASSTHROUGH(void,GL_GetDrawableSize,(SDL_Window *a, int *b, int *c),(a,b,c),)
 SDL3_SYM_PASSTHROUGH(int,GL_SetSwapInterval,(int a),(a),return)
-SDL3_SYM_PASSTHROUGH(int,GL_GetSwapInterval,(void),(),return)
+SDL3_SYM(int,GL_GetSwapInterval,(int *a),(a),return)
 SDL3_SYM(int,GL_SwapWindow,(SDL_Window *a),(a),return)
 SDL3_SYM_PASSTHROUGH(void,GL_DeleteContext,(SDL_GLContext a),(a),)
 SDL3_SYM_PASSTHROUGH(int,vsscanf,(const char *a, const char *b, va_list c),(a,b,c),return)

```
