logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_SetRenderVSync - Toggle VSync of the given renderer.

Availability

       This function is available since SDL 3.2.0.

Description

       When a renderer is created, vsync defaults to SDL_RENDERER_VSYNC_DISABLED.

       The vsync parameter can be 1 to synchronize present with every vertical refresh, 2 to synchronize present
       with  every  second  vertical  refresh, etc., SDL_RENDERER_VSYNC_ADAPTIVE for late swap tearing (adaptive
       vsync), or SDL_RENDERER_VSYNC_DISABLED to disable. Not every value is supported by every driver,  so  you
       should check the return value to see whether the requested setting is supported.

Function Parameters

renderer
              the renderer to toggle.

       vsync  the vertical refresh sync interval.

Name

       SDL_SetRenderVSync - Toggle VSync of the given renderer.

Return Value

       for more information.

See Also

SDL_GetRenderVSync(3)

Simple Directmedia Layer                           SDL 3.2.20                              SDL_SetRenderVSync(3)

Synopsis

#include<SDL3/SDL_render.h>boolSDL_SetRenderVSync(SDL_Renderer*renderer,intvsync);#defineSDL_RENDERER_VSYNC_DISABLED0#defineSDL_RENDERER_VSYNC_ADAPTIVE(-1)

Thread Safety

       This function should only be called on the main thread.

See Also