mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-23 17:32:02 +01:00
uidriver: Rename updateGraphics -> updateSize
This commit is contained in:
parent
f6367308fc
commit
24fdcdd8e4
@ -699,7 +699,7 @@ func (u *UserInterface) actualScreenScale() float64 {
|
||||
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
|
||||
sizeChanged := false
|
||||
// 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.
|
||||
u.updateGraphics(context)
|
||||
u.updateSize(context)
|
||||
|
||||
_ = mainthread.Run(func() error {
|
||||
glfw.PollEvents()
|
||||
@ -764,7 +764,7 @@ func (u *UserInterface) update(context driver.UIContext) error {
|
||||
})
|
||||
if err := context.Update(func() {
|
||||
// The offscreens must be updated every frame (#490).
|
||||
u.updateGraphics(context)
|
||||
u.updateSize(context)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ func (u *UserInterface) actualScreenScale() float64 {
|
||||
return u.getScale() * devicescale.GetAt(0, 0)
|
||||
}
|
||||
|
||||
func (u *UserInterface) updateGraphics() {
|
||||
func (u *UserInterface) updateSize() {
|
||||
a := u.actualScreenScale()
|
||||
if u.lastActualScale != a {
|
||||
u.updateScreenSize()
|
||||
@ -213,9 +213,9 @@ func (u *UserInterface) update() error {
|
||||
u.context.ResumeAudio()
|
||||
|
||||
u.input.UpdateGamepads()
|
||||
u.updateGraphics()
|
||||
u.updateSize()
|
||||
if err := u.context.Update(func() {
|
||||
u.updateGraphics()
|
||||
u.updateSize()
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ func (u *UserInterface) Run(width, height int, scale float64, title string, cont
|
||||
}
|
||||
|
||||
// Force to set the screen size
|
||||
u.updateGraphics(context)
|
||||
u.updateSize(context)
|
||||
for {
|
||||
if err := u.update(context); err != nil {
|
||||
return err
|
||||
@ -193,7 +193,7 @@ func (u *UserInterface) Loop(ch <-chan error) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (u *UserInterface) updateGraphics(context driver.UIContext) {
|
||||
func (u *UserInterface) updateSize(context driver.UIContext) {
|
||||
width, height := 0, 0
|
||||
actualScale := 0.0
|
||||
|
||||
@ -246,7 +246,7 @@ render:
|
||||
}()
|
||||
|
||||
if err := context.Update(func() {
|
||||
u.updateGraphics(context)
|
||||
u.updateSize(context)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user