Hi Shayne,
// shader code done at setup time
tgpProgram = new osg::Program();
...
emptyProgram = new osg::Program();
First, I don't know if you meant not to put the type here, but I hope
you're storing these in ref_ptr<osg::Program>. Otherwise, you create the
program (refCount = 0), then you attach the program to some node
(refCount = 1), then detach it (refCount=0, the program is deleted) and
thus you're using a dangling pointer the next time you try to attach it
to a node.
Second, you're running the code in a draw callback, and not an update
callback. You need to run it in an update callback. The draw traversal
(even the end of the draw traversal) is not a safe place to be modifying
the scene graph.
Can you send us a complete program that shows the problem? It's much
easier that way around.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org