mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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 {
|
if err := ui.CurrentUI().Start(width, height, scale, title); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// TODO: Use the error value
|
|
||||||
defer func() {
|
|
||||||
_ = ui.CurrentUI().Terminate()
|
|
||||||
}()
|
|
||||||
|
|
||||||
n := now()
|
n := now()
|
||||||
currentRunContext.lastUpdated = n
|
currentRunContext.lastUpdated = n
|
||||||
|
@ -21,7 +21,6 @@ type GraphicsContext interface {
|
|||||||
|
|
||||||
type UserInterface interface {
|
type UserInterface interface {
|
||||||
Start(width, height int, scale float64, title string) error
|
Start(width, height int, scale float64, title string) error
|
||||||
Terminate() error
|
|
||||||
AnimationFrameLoop(g GraphicsContext) error
|
AnimationFrameLoop(g GraphicsContext) error
|
||||||
ScreenScale() float64
|
ScreenScale() float64
|
||||||
SetScreenSize(width, height int) (bool, error)
|
SetScreenSize(width, height int) (bool, error)
|
||||||
|
@ -241,15 +241,13 @@ func (u *userInterface) update(g GraphicsContext) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterface) Terminate() error {
|
func (u *userInterface) AnimationFrameLoop(g GraphicsContext) error {
|
||||||
|
defer func() {
|
||||||
_ = u.runOnMainThread(func() error {
|
_ = u.runOnMainThread(func() error {
|
||||||
glfw.Terminate()
|
glfw.Terminate()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
return nil
|
}()
|
||||||
}
|
|
||||||
|
|
||||||
func (u *userInterface) AnimationFrameLoop(g GraphicsContext) error {
|
|
||||||
for {
|
for {
|
||||||
if err := u.update(g); err != nil {
|
if err := u.update(g); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -87,11 +87,6 @@ func (u *userInterface) update(g GraphicsContext) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterface) Terminate() error {
|
|
||||||
// Do nothing.
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (u *userInterface) AnimationFrameLoop(g GraphicsContext) error {
|
func (u *userInterface) AnimationFrameLoop(g GraphicsContext) error {
|
||||||
ch := make(chan error)
|
ch := make(chan error)
|
||||||
var f func()
|
var f func()
|
||||||
|
@ -77,10 +77,6 @@ func (u *userInterface) Start(width, height int, scale float64, title string) er
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterface) Terminate() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (u *userInterface) AnimationFrameLoop(g GraphicsContext) error {
|
func (u *userInterface) AnimationFrameLoop(g GraphicsContext) error {
|
||||||
for {
|
for {
|
||||||
if u.sizeChanged {
|
if u.sizeChanged {
|
||||||
|
Loading…
Reference in New Issue
Block a user