mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-23 17:32:02 +01:00
ui: Refactoring: Simplify the run loop
This commit is contained in:
parent
49a0fc839e
commit
41fae3214b
6
run.go
6
run.go
@ -230,12 +230,6 @@ func run(f func(*Image) error, width, height, scale int, title string) error {
|
|||||||
tt = 1
|
tt = 1
|
||||||
}
|
}
|
||||||
for i := 0; i < tt; i++ {
|
for i := 0; i < tt; i++ {
|
||||||
if err := ui.CurrentUI().DoEvents(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if ui.CurrentUI().IsClosed() {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if err := graphicsContext.update(f); err != nil {
|
if err := graphicsContext.update(f); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user