[osg-users] Android: Survive Context Loss without complete reinitialization
Robert Osfield
robert.osfield at gmail.com
Tue Jul 23 07:50:16 PDT 2019
Hi Martin,
The osg::Node's have releaseGLObjects() that help disconnect the GLObjects
from the scene graph, these get put in several backend containers for the
GLObjects, that get cleaned up by a call to osg::flushAllDeletedGLObjects.
The standard viewer should be doing all this for you, but in your case
you'll be using a non standard route thanks to the constraints of Android
windowing. I'm not the author of the the Android windowing example so
can't comment on the specifics. I guess there is chance there is an error
at the viewer level somewhere.
As general comment, the VSG project is probably a better fit for Android
than the OSG, thanks to both the Vulkan and the lightweight
design/implementation of the VSG. Under Vulkan you create most graphics
objects tied to the Vulkan Instance, when a window is resized or
closed/opened you have to recreate the window related objects, but other
objects can be shared. This recreation of objects happens for all
platforms so it's not a Android special issue like it is for OpenGL, so
it's more likely we'll be able to spot issues and debug them prior to a
port to Android.
The VSG still early it's life though, so feature wise it's a long way
behind the OSG right now. It's still a moving target too, but if you don't
need a wide range of OSG features then you might be able to get by with the
VSG.
Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190723/6f68e6cf/attachment.html>
More information about the osg-users
mailing list