ui: Remove theUIContext, which is not used anywhere

This commit is contained in:
Hajime Hoshi 2019-11-17 22:23:49 +09:00
parent 725cc22200
commit 3c51ee0991

6
run.go
View File

@ -86,8 +86,6 @@ func IsRunningSlowly() bool {
return IsDrawingSkipped() return IsDrawingSkipped()
} }
var theUIContext atomic.Value
// Run runs the game. // Run runs the game.
// f is a function which is called at every frame. // f is a function which is called at every frame.
// The argument (*Image) is the render target that represents the screen. // The argument (*Image) is the render target that represents the screen.
@ -136,8 +134,6 @@ func Run(f func(*Image) error, width, height int, scale float64, title string) e
f = (&imageDumper{f: f}).update f = (&imageDumper{f: f}).update
c := newUIContext(f) c := newUIContext(f)
theUIContext.Store(c)
if err := uiDriver().Run(width, height, scale, title, c, graphicsDriver()); err != nil { if err := uiDriver().Run(width, height, scale, title, c, graphicsDriver()); err != nil {
if err == driver.RegularTermination { if err == driver.RegularTermination {
return nil return nil
@ -157,8 +153,6 @@ func RunWithoutMainLoop(f func(*Image) error, width, height int, scale float64,
f = (&imageDumper{f: f}).update f = (&imageDumper{f: f}).update
c := newUIContext(f) c := newUIContext(f)
theUIContext.Store(c)
return uiDriver().RunWithoutMainLoop(width, height, scale, title, c, graphicsDriver()) return uiDriver().RunWithoutMainLoop(width, height, scale, title, c, graphicsDriver())
} }