SDL_RENDERER_PRESENTVSYNC Across Backend Drivers
0 reputation · 26 Jul 2026, 18:17 UTC
The objective is to establish repeatable frame pacing for SDL2 and SDL3 applications across diverse render backends (Direct3D, OpenGL, Metal, Vulkan, software) without per-backend adaptation. SDL_RENDERER_PRESENTVSYNC (SDL2) or SDL_SetRenderVSync (SDL3) requests synchronization with the display refresh cycle, but driver and compositor behavior is not guaranteed; Wayland and X11 window managers, as well as the Windows Desktop Window Manager, may override or ignore the flag. Additionally, SDL_RenderSetLogicalSize combined with SDL_SetRenderLogicalPresentation decouples render resolution from window dimensions, and the chosen scaling mode-letterbox, stretch, or integer-alters the presented frame size and can influence timing perception. The decision of whether to rely on vsync-driven presentation or supplement with a manual frame limiter using SDL_Delay and a high-resolution timer remains unresolved, as backend-specific present-blocking semantics introduce variance in measured frame intervals.
Does SDL_SetRenderVSync interval persist when the active renderer backend is switched at runtime? Can SDL_HINT_RENDER_DRIVER be combined with vsync enforcement to achieve deterministic pacing? Does logical presentation scaling mode affect vsync timing differently across OpenGL and Vulkan backends?