mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
ui: Update input status per frame
This commit is contained in:
parent
b3d7e04de5
commit
db2a43217e
6
run.go
6
run.go
@ -109,6 +109,12 @@ func Run(f func(*Image) error, width, height, scale int, title string) error {
|
||||
c := int((now - beforeForUpdate) * 60 / int64(time.Second))
|
||||
runContext.isRunningSlowly = c >= 2
|
||||
for i := 0; i < c; i++ {
|
||||
if err := ui.DoEvents(); err != nil {
|
||||
return err
|
||||
}
|
||||
if ui.IsClosed() {
|
||||
return nil
|
||||
}
|
||||
if err := graphicsContext.update(f); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user