ui: Bug fix: exit update function once when the context is lost (#526)

This commit is contained in:
Hajime Hoshi 2018-03-02 00:55:37 +09:00
parent dada2e060a
commit 4c1cc9e699

View File

@ -137,7 +137,12 @@ func (u *userInterface) update(g GraphicsContext) error {
if opengl.GetContext().IsContextLost() {
opengl.GetContext().RestoreContext()
g.Invalidate()
// Need to return once to wait restored (#526)
// TODO: Is it necessary to handle webglcontextrestored event?
return nil
}
currentInput.updateGamepads()
u.updateGraphicsContext(g)
if err := g.Update(func() {