misc: chore: [ci skip] VSync progression as an extension

This commit is contained in:
Evan Husted 2025-01-30 16:53:55 -06:00
parent 359852b5c0
commit 04ce7fb764
2 changed files with 16 additions and 17 deletions

View file

@ -6,4 +6,16 @@ namespace Ryujinx.Common.Configuration
Unbounded,
Custom
}
public static class VSyncModeExtensions
{
public static VSyncMode Next(this VSyncMode vsync, bool customEnabled = false) =>
vsync switch
{
VSyncMode.Switch => customEnabled ? VSyncMode.Custom : VSyncMode.Unbounded,
VSyncMode.Unbounded => VSyncMode.Switch,
VSyncMode.Custom => VSyncMode.Unbounded,
_ => VSyncMode.Switch
};
}
}