Hi Jimmy, The problem you have is that you are detaching the scene graph from the viewer so the viewer no longer knows anything about it, then you destroy the viewer and assocaited window which would normally clear all the GL objects in the scene graph, but in your case because you've hidden the scene graph from it it does clear the GL objects.
Next you reassign these scene graph elements to a new viewer/graphics context and but since the GL objects ID's cached by the scene graph are the ones for the deleted graphics context when rendering happens the wrong ID's are passed to GL, resulting in problems, anything from rendering problems to crashes. The solution is manually do a releaseGLObjects and the scene graph when you detach them from the viewer and before you destroy the viewers graphics context. Robert. On Wed, Aug 12, 2009 at 7:31 AM, Jimmy Lin<dummy...@gmail.com> wrote: > Hi, > > In my app, I allow user to restart the scene by > - keeping all the nodes but disconnect all nodes from the scene root node > - recreate new graphic context and composite viewer. > - assign the root node to the new viewer. > > If the user create some object which was created in last session, I will find > that node and reconnect it to the scene root. > > At the moment I have problem to see the reconnected node. It does connected > to the root correctly and all the data seems ok. It even shows up in the > stats (all number of Group, StateSet are correct). But I just can't see it on > the screen. It seems it just didn't get dispatch to the card. > > By taking a really long shot guess, is there a cache system store in the > node? the node think there should be a cache but it's not exist in the new > context/viewer? > > Does anyone able to shine some light on this? > > Thank you! > > Cheers, > Jimmy > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=16118#16118 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org