mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-09 17:43:18 +01:00
uidriver/glfw: Refactoring
This commit is contained in:
parent
1d82aec712
commit
f39f80c7c3
@ -820,16 +820,17 @@ func (u *UserInterface) update() (float64, float64, bool, error) {
|
|||||||
|
|
||||||
outsideWidth, outsideHeight, outsideSizeChanged := u.updateSize()
|
outsideWidth, outsideHeight, outsideSizeChanged := u.updateSize()
|
||||||
|
|
||||||
|
// TODO: Updating the input can be skipped when clock.Update returns 0 (#1367).
|
||||||
glfw.PollEvents()
|
glfw.PollEvents()
|
||||||
u.input.update(u.window, u.context)
|
u.input.update(u.window, u.context)
|
||||||
|
|
||||||
defer hooks.ResumeAudio()
|
|
||||||
for !u.isRunnableOnUnfocused() && u.window.GetAttrib(glfw.Focused) == 0 && !u.window.ShouldClose() {
|
for !u.isRunnableOnUnfocused() && u.window.GetAttrib(glfw.Focused) == 0 && !u.window.ShouldClose() {
|
||||||
hooks.SuspendAudio()
|
hooks.SuspendAudio()
|
||||||
// Wait for an arbitrary period to avoid busy loop.
|
// Wait for an arbitrary period to avoid busy loop.
|
||||||
time.Sleep(time.Second / 60)
|
time.Sleep(time.Second / 60)
|
||||||
glfw.PollEvents()
|
glfw.PollEvents()
|
||||||
}
|
}
|
||||||
|
hooks.ResumeAudio()
|
||||||
|
|
||||||
return outsideWidth, outsideHeight, outsideSizeChanged, nil
|
return outsideWidth, outsideHeight, outsideSizeChanged, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user