ui: Refactoring

This commit is contained in:
Hajime Hoshi 2016-07-23 18:57:19 +09:00
parent e3ef0540a3
commit 0276be6c69

5
run.go
View File

@ -73,7 +73,10 @@ func Run(f func(*Image) error, width, height int, scale float64, title string) e
ch := make(chan error) ch := make(chan error)
go func() { go func() {
g := newGraphicsContext(f) g := newGraphicsContext(f)
ch <- loop.Run(g, width, height, scale, title, FPS) if err := loop.Run(g, width, height, scale, title, FPS); err != nil {
ch <- err
}
close(ch)
}() }()
ui.Main() ui.Main()
return <-ch return <-ch