mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
internal/ui: refactoring
This commit is contained in:
parent
4d89b5de07
commit
dd853050e9
@ -1071,8 +1071,14 @@ func (u *userInterfaceImpl) loopGame() error {
|
||||
u.window.Destroy()
|
||||
glfw.Terminate()
|
||||
})
|
||||
|
||||
for {
|
||||
if err := u.updateGame(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (u *userInterfaceImpl) updateGame() error {
|
||||
var unfocused bool
|
||||
|
||||
// On Windows, the focusing state might be always false (#987).
|
||||
@ -1157,7 +1163,8 @@ func (u *userInterfaceImpl) loopGame() error {
|
||||
time.Sleep(wait - d)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// swapBuffers must be called from the main thread.
|
||||
|
Loading…
Reference in New Issue
Block a user