From 85d172c673faff656ba771a7129d7882c2bd8ead Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 19 Aug 2020 23:59:23 +0900 Subject: [PATCH] uidriver/mobile: Bug fix: The context didn't recovered on gomobile-build Updates #1176 --- internal/uidriver/mobile/ui.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/uidriver/mobile/ui.go b/internal/uidriver/mobile/ui.go index bb61d5452..fa9ba77d4 100644 --- a/internal/uidriver/mobile/ui.go +++ b/internal/uidriver/mobile/ui.go @@ -35,6 +35,7 @@ import ( "github.com/hajimehoshi/ebiten/internal/driver" "github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl" "github.com/hajimehoshi/ebiten/internal/hooks" + "github.com/hajimehoshi/ebiten/internal/restorable" "github.com/hajimehoshi/ebiten/internal/thread" ) @@ -159,6 +160,7 @@ func (u *UserInterface) appMain(a app.App) { switch e.Crosses(lifecycle.StageVisible) { case lifecycle.CrossOn: u.SetForeground(true) + restorable.OnContextLost() glctx, _ = e.DrawContext.(gl.Context) // Assume that glctx is always a same instance. // Then, only once initializing should be enough.