Hi All,

I have now completed the bulk of my work on the new osg::Callback
class, this along with the more familiar callbacks like NodeCallback
can now be found in the include/osg/Callback header file.  You can now
subclass directly from osg::Callback and attach to
Node/Drawable/StateSet/StateAttribute, or use the old callback
classes.  These changes are now checked into svn/trunk.

With these changes the unit test of update callbacks that Pjotr wrote
now generates the correct output - try osgcallback --test, you should
see all 7 entries.

I haven't yet done full testing of all the different ways you can add
callbacks.  I also have yet tested whether you can assign script
callbacks to Node/Drawable via the Node::setUpdateCallback etc
methods, but in theory this should now be possible.  I'll test more of
this tomorrow.

I have to make quite a number of changes to the core OSG to get things
working, but fingers crossed most users shouldn't need to make too
many changes to their own code.  Main issues would be if you do a
osg::NodeCallback* cb = node->getUpdateCallback(), as
getUpdateCallback() now returns an osg::Callback, just changing to
osg::Callback* cb = node->getUpdateCallback() should mostly address
the issue.  Another compile issue I came across was when handling
classes that use multiple inheritance and had to explicitly specifying
the osg::Obejct copy construction as osg::Object used to be inherited
as a virtual inheritance. Whereas now the callback subclass subclass
via virtual inheritance from osg::Callback instead so you need to
specify osg::Callback copy construction in place of the osg::Object
entry in the subclasses copy constructor.  I hope that makes sense..

Let me know if you see any problems.  I have only been able to test
under Linux, fingers crossed I haven't missed any OSG_EXPORT, but if I
have let me know and get fixes checked in as soon as possible.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to