mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -04:00
Don't always recreate context when changing FPS, only do when vsync state changes, and only on direct3d9 backend.
This commit is contained in:
parent
0b3cbfac7a
commit
7000e9d0c1
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user