mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
uidriver/glfw: Refactoring
This commit is contained in:
parent
d2c4a6fc9f
commit
1db7bed2a7
@ -854,14 +854,11 @@ func (u *UserInterface) update() error {
|
||||
_ = u.t.Call(func() error {
|
||||
defer hooks.ResumeAudio()
|
||||
|
||||
for !u.isRunnableOnUnfocused() && u.window.GetAttrib(glfw.Focused) == 0 {
|
||||
for !u.isRunnableOnUnfocused() && u.window.GetAttrib(glfw.Focused) == 0 && !u.window.ShouldClose() {
|
||||
hooks.SuspendAudio()
|
||||
// Wait for an arbitrary period to avoid busy loop.
|
||||
time.Sleep(time.Second / 60)
|
||||
glfw.PollEvents()
|
||||
if u.window.ShouldClose() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user