I'm working on a game app with a few screens, each screen is made and handled in its own events.
I'm getting odd behavior when my app looses focus (e.g. home button, call, text, etc.). The events seem to be firing in the correct order:
but when you switch back there are no background graphics being rendered (see attached images). You can still interact with the UI to return to a previous screen (menu) and then go back to the game screen but from that point forward the background textures are black or display some other random part of the atlas.
The backgrounds are lgTexture objects initialized with pixmap from my asset manager then the texture is used to create a lgScn2DTextureRegionDrawable object that is set to the background of a lgscn2DTable in the scene.
Should I need to dispose and re-create the background textures in the pause/resume events for the screen?
I'm getting odd behavior when my app looses focus (e.g. home button, call, text, etc.). The events seem to be firing in the correct order:
B4X:
GameScreen_SHOW
** Activity (main) Pause, UserClosed = false **
ACTIVITY_PAUSE
sensor listener tear down
GameScreen_PAUSE
paused
** Activity (main) Resume **
ACTIVITY_RESUME
sensor listener setup
framebuffer: (5, 6, 5, 0)
depthbuffer: (24)
stencilbuffer: (8)
samples: (0)
coverage sampling: (false)
Managed meshes/app: { 1 }
Managed textures/app: { 8 }
Managed shaders/app: { 1 }
Managed buffers/app: { }
GameScreen_RESUME
resumed
The backgrounds are lgTexture objects initialized with pixmap from my asset manager then the texture is used to create a lgScn2DTextureRegionDrawable object that is set to the background of a lgscn2DTable in the scene.
Should I need to dispose and re-create the background textures in the pause/resume events for the screen?