mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
ui: Bug fix: exit update function once when the context is lost (#526)
This commit is contained in:
parent
dada2e060a
commit
4c1cc9e699
@ -137,7 +137,12 @@ func (u *userInterface) update(g GraphicsContext) error {
|
|||||||
if opengl.GetContext().IsContextLost() {
|
if opengl.GetContext().IsContextLost() {
|
||||||
opengl.GetContext().RestoreContext()
|
opengl.GetContext().RestoreContext()
|
||||||
g.Invalidate()
|
g.Invalidate()
|
||||||
|
|
||||||
|
// Need to return once to wait restored (#526)
|
||||||
|
// TODO: Is it necessary to handle webglcontextrestored event?
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
currentInput.updateGamepads()
|
currentInput.updateGamepads()
|
||||||
u.updateGraphicsContext(g)
|
u.updateGraphicsContext(g)
|
||||||
if err := g.Update(func() {
|
if err := g.Update(func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user