diff --git a/src/Stride.CommunityToolkit/Games/GameExtensions.cs b/src/Stride.CommunityToolkit/Games/GameExtensions.cs index 897bec6..56c5222 100644 --- a/src/Stride.CommunityToolkit/Games/GameExtensions.cs +++ b/src/Stride.CommunityToolkit/Games/GameExtensions.cs @@ -54,4 +54,22 @@ public static void SetMaxFPS(this IGame game, int targetFPS) var gameBase = (GameBase)game; gameBase.WindowMinimumUpdateRate.MinimumElapsedTime = TimeSpan.FromMilliseconds(1000f / targetFPS); } + + /// + /// Enables vertical synchronization (VSync) to prevent screen tearing. + /// + /// + public static void EnableVSync(this IGame game) + { + game.GraphicsDevice.Presenter.PresentInterval = Stride.Graphics.PresentInterval.Two; + } + + /// + /// Disables vertical synchronization (VSync) to allow for uncapped frame rates. + /// + /// + public static void DisableVSync(this IGame game) + { + game.GraphicsDevice.Presenter.PresentInterval = Stride.Graphics.PresentInterval.Immediate; + } } \ No newline at end of file