ui: Remove Terminate

This commit is contained in:
Hajime Hoshi 2016-09-02 01:07:41 +09:00
parent 6da16aa1a0
commit 453c2c4589
5 changed files with 6 additions and 22 deletions

View File

@ -112,10 +112,6 @@ func Run(g GraphicsContext, width, height int, scale float64, title string, fps
if err := ui.CurrentUI().Start(width, height, scale, title); err != nil {
return err
}
// TODO: Use the error value
defer func() {
_ = ui.CurrentUI().Terminate()
}()
n := now()
currentRunContext.lastUpdated = n

View File

@ -21,7 +21,6 @@ type GraphicsContext interface {
type UserInterface interface {
Start(width, height int, scale float64, title string) error
Terminate() error
AnimationFrameLoop(g GraphicsContext) error
ScreenScale() float64
SetScreenSize(width, height int) (bool, error)

View File

@ -241,15 +241,13 @@ func (u *userInterface) update(g GraphicsContext) error {
return nil
}
func (u *userInterface) Terminate() error {
_ = u.runOnMainThread(func() error {
glfw.Terminate()
return nil
})
return nil
}
func (u *userInterface) AnimationFrameLoop(g GraphicsContext) error {
defer func() {
_ = u.runOnMainThread(func() error {
glfw.Terminate()
return nil
})
}()
for {
if err := u.update(g); err != nil {
return err

View File

@ -87,11 +87,6 @@ func (u *userInterface) update(g GraphicsContext) error {
return nil
}
func (u *userInterface) Terminate() error {
// Do nothing.
return nil
}
func (u *userInterface) AnimationFrameLoop(g GraphicsContext) error {
ch := make(chan error)
var f func()

View File

@ -77,10 +77,6 @@ func (u *userInterface) Start(width, height int, scale float64, title string) er
return nil
}
func (u *userInterface) Terminate() error {
return nil
}
func (u *userInterface) AnimationFrameLoop(g GraphicsContext) error {
for {
if u.sizeChanged {