internal/ui: call a graphics driver's SetFPSMode only when necessary

It was odd to call this in the swapBufferForGL function.
This commit is contained in:
Hajime Hoshi 2023-10-28 14:50:30 +09:00
parent 61498e899a
commit 98f2798b07

View File

@ -1317,6 +1317,10 @@ func (u *UserInterface) setFPSMode(fpsMode FPSModeType) error {
return err
}
u.renderThread.CallAsync(func() {
u.graphicsDriver.SetVsyncEnabled(u.fpsMode == FPSModeVsyncOn)
})
return nil
}
@ -1894,7 +1898,6 @@ func (u *UserInterface) updateVsyncOnRenderThread() error {
}
}
}
u.graphicsDriver.SetVsyncEnabled(u.fpsMode == FPSModeVsyncOn)
return nil
}