Don't always recreate context when changing FPS, only do when vsync state changes, and only on direct3d9 backend.

This commit is contained in:
UnknownShadow200 2017-09-19 15:26:55 +10:00
parent 0b3cbfac7a
commit 7000e9d0c1
2 changed files with 2 additions and 5 deletions

View File

@ -246,10 +246,6 @@ namespace ClassicalSharp.Gui.Screens {
object raw = Enum.Parse(typeof(FpsLimitMethod), v);
g.SetFpsLimitMethod((FpsLimitMethod)raw);
Options.Set(OptionsKey.FpsLimit, v);
// NOTE: OpenGL backend doesn't recreate context, so cheat and act like recreated anyways
ContextLost();
ContextRecreated();
}
}
}

View File

@ -470,8 +470,9 @@ namespace ClassicalSharp.GraphicsAPI {
bool vsync = false;
public override void SetVSync(Game game, bool value) {
vsync = value;
game.VSync = value;
if (vsync == value) return;
vsync = value;
LoseContext(" (toggling VSync)");
RecreateDevice(game);