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 β€” an int that 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 read SDL_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 ⭐


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