SDL_HINT_RENDER_VSYNC(3)
π¦ SDL_HINT_RENDER_VSYNC π¦
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_HINT_RENDER_VSYNC β yes she's a hint, yes she's iconic, and yes she is literally the thing that controls whether updates to the SDL screen surface get synchronized with the vertical refresh so you don't get that ugly tearing situation. no cap, tearing is the enemy. π
β¨ NAME β¨
SDL_HINT_RENDER_VSYNC β a variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_hints.h>
#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
like, that's it. that's the whole entrance. she's lowkey simple but highkey powerful. π
π DESCRIPTION π
so the tea is: this hint overrides the application preference when creating a renderer. the app thinks it knows what it wants? cute. this hint said "not today." π
the variable can be set to the following values:
"0"β Disable vsync. (this is the default, so if you don't say anything, vsync is off, periodt)"1"β Enable vsync. β¨
β οΈ bestie listen β this hint should be set before creating a renderer. it's giving "timing is everything." set it first or it simply won't hit the same. π
π AVAILABILITY π
this hint is available since SDL 3.2.0. she's not ancient, she's not brand new β she's just right. π«Ά
and that's the whole vibe check, bestie. go forth and render tear-free. π¦β¨
Simple Directmedia Layer Β· SDL 3.4.18 Β· mwah, drink water, and may your frames never tear ππ
π¦ 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