I'm using a modified version of the Image Targets sample project that I have integrated with an open source game engine. I'm having some issues dealing with the activity lifecycle of my app. When the main activity is paused and then resumed, I am getting the pose matrix information from Vuforia that I'm then sending to my game engine, but the glView is all black. I should mention that I changed the way views are working by using addContentView() with the glView and then I use addContentView() again but with a framelayout, and a child listview on the right. This setup works fine until the state changes take place and I'm wondering if there is anything I'm missing that I need to do with my game engine, or if maybe I've messed up how the glView is doing it's thing. Any advice?
"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team
onResume black screen, but pose matrix still being created
By mpellegr
on Fri, 08/09/2013 - 21:20
onResume black screen, but pose matrix still being created
Hi, hard to tell what goes wrong: maybe some OpenGL state is not cleaned up properly in your engine when you pause/resume, or perhaps it could be that the view layout that you are using is creating some issues.
onResume black screen, but pose matrix still being created
I'm assuming the OpenGL context between the game engine and vuforia is the same, so where can I find out more about how Vuforia handles that?
onResume black screen, but pose matrix still being created
I found a solution that works. There's a method for API 11 that allows gl contexts to be preserved for the glSurfaceView when the activtiy is paused. I just added
onResume black screen, but pose matrix still being created
That sounds great!
Concerning the context destruction, afaik Vuforia does not destroy the gl context on pause.
onResume black screen, but pose matrix still being created
From what I just read on the Android docs, it seems the glSurfaceView class does when you call onPause on it, which is required when you pause your activity.
onResume black screen, but pose matrix still being created
Vuforia uses the gl context to render the video background.