mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
ui: Remove Terminate
This commit is contained in:
parent
6da16aa1a0
commit
453c2c4589
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user