SDL_GetWindowSurfaceVSync(3)
β¨ SDL_GetWindowSurfaceVSync β¨
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual β this one's a lil three-line wonder and she's lowkey iconic π
πΈ NAME πΈ
SDL_GetWindowSurfaceVSync β grab the VSync setting for a window surface. that's it. that's the whole job. she asks, she doesn't tell π«Ά
π¦ SYNOPSIS π¦
#include <SDL3/SDL_video.h>
bool SDL_GetWindowSurfaceVSync(SDL_Window *window, int *vsync);
one include, one call, no drama β¨
π FUNCTION PARAMETERS π
windowβ the window you wanna interrogate. yes, that window. the one you're curious about πvsyncβ anintthat gets filled in with the current vertical refresh sync interval. pro tip: if you're like "wait what does that number even mean tho", go readSDL_SetWindowSurfaceVSync()β that's where the meaning of the value lives π
π RETURN VALUE π
returns true when it goes well, false when it does not π and if it's false, hit up SDL_GetError() for the tea on what went wrong.
π§ THREAD SAFETY π§
β οΈ main thread only, bestie. this function should only be called on the main thread. no sneaking it onto a worker thread, no cap π«π§΅
π AVAILABILITY π
this bad girl has been available since SDL 3.2.0 π (so if you're on something older... my condolences, fr fr)
β SEE ALSO β
SDL_SetWindowSurfaceVSync(3)β the setter to this getter, the other half of the ship π«Ά
and that's the whole page, you ate it up π
signing off from Simple Directmedia Layer, version SDL 3.4.18, in the year of our lord SDL_GetWindowSurfaceVSync(3) β mwah, go touch some grass and then go read your vsync value πΈπ¦π
π¦ 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