mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
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:
parent
61498e899a
commit
98f2798b07
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user