SDL_GL_GetSwapInterval(3)
π SDL_GL_GetSwapInterval(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_GL_GetSwapInterval β she's the one who tells you how your OpenGL context is vibing with vsync. π¦
β¨ NAME β¨
SDL_GL_GetSwapInterval β get the swap interval for the current OpenGL context. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_video.h>
bool SDL_GL_GetSwapInterval(int *interval);
β¨ DESCRIPTION β¨
so like, here's the tea β: if the system literally cannot figure out the swap interval, or if there's just no valid current context hanging around, this function will set *interval to 0 as a safe default. no drama, no crash, just a chill little zero. π
β¨ FUNCTION PARAMETERS β¨
intervalβ this is your output interval value, and she comes in three flavors, bestie:0β there is no vertical retrace synchronization. free-spirited. unbothered. π1β the buffer swap is synchronized with the vertical retrace. synchronized queen behavior. π-1β late swaps happen immediately instead of waiting for the next retrace. she does NOT wait. π
β¨ RETURN VALUE β¨
Returns true on success or false on failure β and if it fails, call SDL_GetError() for more information, because she will tell you what went wrong. π₯
β¨ THREAD SAFETY β¨
π¨ bestie listen. This function should only be called on the main thread. Do not be cute about it. Do not try it from a worker thread. Just don't. π
β¨ AVAILABILITY β¨
This function is available since SDL 3.2.0. β¨
β¨ SEE ALSO β¨
SDL_GL_SetSwapInterval(3)β the other half of this iconic duo, go read her too. π«Ά
and that's the whole page, no cap. π this little slice of the manual was brought to you by Simple Directmedia Layer, running on SDL 3.4.18, and yeah she's giving SDL_GL_GetSwapInterval(3) energy from start to finish. mwah, go forth and sync responsibly. ππβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms