# SetVSync

## Description

Sets whether vertical sync should be turned on or off. This is the preferred method of limiting the frame rate as it will link the frame rate to the monitor refresh rate and avoid tearing or stuttering. Using this command with mode 1 will override any currently set refresh rate from SetSyncRate, otherwise these two commands would fight each other for control of the frame rate, instead AGK will use the VSync refresh rate which is typically 60 frames per second, but depends on the monitor.
On Linux, Mac, and HTML5 you can use a value greater than 1 to skip refreshes, for example if the monitor refresh rate is 60Hz then a mode value of 1 would limit the app to 60fps, but a mode value of 2 would skip every other refresh which would limit the app to 30fps.

## Definition

SetVSync( mode )

void agk::SetVSync( int mode )

## Parameters

- mode - 1 to turn vsync on, 0 to turn it off.