uidriver: Rename updateGraphics -> updateSize

This commit is contained in:
Hajime Hoshi 2019-04-08 23:49:31 -04:00
parent f6367308fc
commit 24fdcdd8e4
3 changed files with 9 additions and 9 deletions

View File

@ -699,7 +699,7 @@ func (u *UserInterface) actualScreenScale() float64 {
return u.getScale() * devicescale.GetAt(u.currentMonitor().GetPos()) return u.getScale() * devicescale.GetAt(u.currentMonitor().GetPos())
} }
func (u *UserInterface) updateGraphics(context driver.UIContext) { func (u *UserInterface) updateSize(context driver.UIContext) {
actualScale := 0.0 actualScale := 0.0
sizeChanged := false sizeChanged := false
// TODO: Is it possible to reduce 'runOnMainThread' calls? // TODO: Is it possible to reduce 'runOnMainThread' calls?
@ -742,7 +742,7 @@ func (u *UserInterface) update(context driver.UIContext) error {
}) })
// This call is needed for initialization. // This call is needed for initialization.
u.updateGraphics(context) u.updateSize(context)
_ = mainthread.Run(func() error { _ = mainthread.Run(func() error {
glfw.PollEvents() glfw.PollEvents()
@ -764,7 +764,7 @@ func (u *UserInterface) update(context driver.UIContext) error {
}) })
if err := context.Update(func() { if err := context.Update(func() {
// The offscreens must be updated every frame (#490). // The offscreens must be updated every frame (#490).
u.updateGraphics(context) u.updateSize(context)
}); err != nil { }); err != nil {
return err return err
} }

View File

@ -188,7 +188,7 @@ func (u *UserInterface) actualScreenScale() float64 {
return u.getScale() * devicescale.GetAt(0, 0) return u.getScale() * devicescale.GetAt(0, 0)
} }
func (u *UserInterface) updateGraphics() { func (u *UserInterface) updateSize() {
a := u.actualScreenScale() a := u.actualScreenScale()
if u.lastActualScale != a { if u.lastActualScale != a {
u.updateScreenSize() u.updateScreenSize()
@ -213,9 +213,9 @@ func (u *UserInterface) update() error {
u.context.ResumeAudio() u.context.ResumeAudio()
u.input.UpdateGamepads() u.input.UpdateGamepads()
u.updateGraphics() u.updateSize()
if err := u.context.Update(func() { if err := u.context.Update(func() {
u.updateGraphics() u.updateSize()
}); err != nil { }); err != nil {
return err return err
} }

View File

@ -174,7 +174,7 @@ func (u *UserInterface) Run(width, height int, scale float64, title string, cont
} }
// Force to set the screen size // Force to set the screen size
u.updateGraphics(context) u.updateSize(context)
for { for {
if err := u.update(context); err != nil { if err := u.update(context); err != nil {
return err return err
@ -193,7 +193,7 @@ func (u *UserInterface) Loop(ch <-chan error) error {
return nil return nil
} }
func (u *UserInterface) updateGraphics(context driver.UIContext) { func (u *UserInterface) updateSize(context driver.UIContext) {
width, height := 0, 0 width, height := 0, 0
actualScale := 0.0 actualScale := 0.0
@ -246,7 +246,7 @@ render:
}() }()
if err := context.Update(func() { if err := context.Update(func() {
u.updateGraphics(context) u.updateSize(context)
}); err != nil { }); err != nil {
return err return err
} }