mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: use a more precise timer for Windows
When SetScreenClearedEveryFalse(false) and SetVsyncEnabled(false), Draw might not be called as often as expected on Windows due to its timer precision. This change improves the situation. Updates #2889
This commit is contained in:
parent
d8af23b437
commit
7e4cdf5211
@ -242,3 +242,13 @@ func (u *UserInterface) skipTaskbar() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
if microsoftgdk.IsXbox() {
|
||||
// TimeBeginPeriod might not be defined in Xbox.
|
||||
return
|
||||
}
|
||||
// Use a better timer resolution (golang/go#44343).
|
||||
// TODO: This might not be necessary from Go 1.23.
|
||||
windows.TimeBeginPeriod(1)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user