ui: Update input status per frame

This commit is contained in:
Hajime Hoshi 2016-02-28 02:32:09 +09:00
parent b3d7e04de5
commit db2a43217e

6
run.go
View File

@ -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
}