mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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()
|
u.window.Destroy()
|
||||||
glfw.Terminate()
|
glfw.Terminate()
|
||||||
})
|
})
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
if err := u.updateGame(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *userInterfaceImpl) updateGame() error {
|
||||||
var unfocused bool
|
var unfocused bool
|
||||||
|
|
||||||
// On Windows, the focusing state might be always false (#987).
|
// On Windows, the focusing state might be always false (#987).
|
||||||
@ -1157,7 +1163,8 @@ func (u *userInterfaceImpl) loopGame() error {
|
|||||||
time.Sleep(wait - d)
|
time.Sleep(wait - d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// swapBuffers must be called from the main thread.
|
// swapBuffers must be called from the main thread.
|
||||||
|
Loading…
Reference in New Issue
Block a user