mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
uidriver/mobile: Bug fix: The context didn't recovered on gomobile-build
Updates #1176
This commit is contained in:
parent
bb50887bae
commit
85d172c673
@ -35,6 +35,7 @@ import (
|
|||||||
"github.com/hajimehoshi/ebiten/internal/driver"
|
"github.com/hajimehoshi/ebiten/internal/driver"
|
||||||
"github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl"
|
"github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl"
|
||||||
"github.com/hajimehoshi/ebiten/internal/hooks"
|
"github.com/hajimehoshi/ebiten/internal/hooks"
|
||||||
|
"github.com/hajimehoshi/ebiten/internal/restorable"
|
||||||
"github.com/hajimehoshi/ebiten/internal/thread"
|
"github.com/hajimehoshi/ebiten/internal/thread"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -159,6 +160,7 @@ func (u *UserInterface) appMain(a app.App) {
|
|||||||
switch e.Crosses(lifecycle.StageVisible) {
|
switch e.Crosses(lifecycle.StageVisible) {
|
||||||
case lifecycle.CrossOn:
|
case lifecycle.CrossOn:
|
||||||
u.SetForeground(true)
|
u.SetForeground(true)
|
||||||
|
restorable.OnContextLost()
|
||||||
glctx, _ = e.DrawContext.(gl.Context)
|
glctx, _ = e.DrawContext.(gl.Context)
|
||||||
// Assume that glctx is always a same instance.
|
// Assume that glctx is always a same instance.
|
||||||
// Then, only once initializing should be enough.
|
// Then, only once initializing should be enough.
|
||||||
|
Loading…
Reference in New Issue
Block a user