ui: Rename Main -> Run

This commit is contained in:
Hajime Hoshi 2016-09-02 02:59:40 +09:00
parent 571d67f967
commit 128dcaa342
4 changed files with 6 additions and 6 deletions

View File

@ -76,11 +76,11 @@ func initialize() error {
return nil return nil
} }
func Main(ch <-chan error) error { func Run(ch <-chan error) error {
return currentUI.main(ch) return currentUI.run(ch)
} }
func (u *userInterface) main(ch <-chan error) error { func (u *userInterface) run(ch <-chan error) error {
// TODO: Check this is done on the main thread. // TODO: Check this is done on the main thread.
for { for {
select { select {

View File

@ -258,7 +258,7 @@ func devicePixelRatio() float64 {
return ratio return ratio
} }
func Main(ch <-chan error) error { func Run(ch <-chan error) error {
return <-ch return <-ch
} }

View File

@ -24,7 +24,7 @@ import (
"github.com/hajimehoshi/ebiten/internal/graphics/opengl" "github.com/hajimehoshi/ebiten/internal/graphics/opengl"
) )
func Main(ch <-chan error) error { func Run(ch <-chan error) error {
return errors.New("ui: don't call this: use RunWithoutMainLoop instead of Run") return errors.New("ui: don't call this: use RunWithoutMainLoop instead of Run")
} }

2
run.go
View File

@ -82,7 +82,7 @@ func Run(f func(*Image) error, width, height int, scale float64, title string) e
close(ch) close(ch)
}() }()
// TODO: Use context in Go 1.7? // TODO: Use context in Go 1.7?
if err := ui.Main(ch); err != nil { if err := ui.Run(ch); err != nil {
return err return err
} }
return nil return nil