Commit Graph

11 Commits

Author SHA1 Message Date
Robert Osfield
dd996a3289 Introduced CMake option OSG_PROVIDE_READFILE option that defaults to ON, but when switched to OFF disables the building of the osgDB::read*File() methods,
forcing users to use osgDB::readRef*File() methods.  The later is preferable as it closes a potential threading bug when using paging databases in conjunction
with the osgDB::Registry Object Cache.  This threading bug occurs when one thread gets an object from the Cache via an osgDB::read*File() call where only
a pointer to the object is passed back, so taking a reference to the object is delayed till it gets reassigned to a ref_ptr<>, but at the same time another
thread calls a flush of the Object Cache deleting this object as it's referenceCount is now zero.  Using osgDB::readREf*File() makes sure the a ref_ptr<> is
passed back and the referenceCount never goes to zero.

To ensure the OSG builds when OSG_PROVIDE_READFILE is to OFF the many cases of osgDB::read*File() usage had to be replaced with a ref_ptr<> osgDB::readRef*File()
usage.  The avoid this change causing lots of other client code to be rewritten to handle the use of ref_ptr<> in place of C pointer I introduced a serious of
templte methods in various class to adapt ref_ptr<> to the underly C pointer to be passed to old OSG API's, example of this is found in include/osg/Group:

    bool addChild(Node* child); // old method which can only be used with a Node*

    tempalte<class T> bool addChild(const osg::ref_ptr<T>& child) { return addChild(child.get()); } // adapter template method

These changes together cover 149 modified files, so it's a large submission. This extent of changes are warrent to make use of the Object Cache
and multi-threaded loaded more robust.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15164 16af8721-9629-0410-8352-f15c8da7e697
2015-10-22 13:42:19 +00:00
Robert Osfield
0a1db3d6fc From Jannik Heller, typo fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14832 16af8721-9629-0410-8352-f15c8da7e697
2015-04-13 10:43:56 +00:00
Robert Osfield
4a660f6266 Introduce new osgGA::Event and osgGA::EventHandler base classes that the old GUIEventAdapter and GUIEventHandler now subclass from.
The new osgGA::Event is written to support more generic events than the original GUIEventAdapter which are written for keyboard and mouse events.
2013-10-25 14:54:15 +00:00
Robert Osfield
7e7135be59 From Cedric Pinson, updates to osganimation example to keep in sync with changes with osgAnimation, and introduction of a hardware skinning example 2009-10-28 13:31:24 +00:00
Robert Osfield
e1b3874fd2 From Cedric Pinson, "Here an update of osganimationtimeline example, the callback did not
follow the callback api, i updated to fix this, then the callback are
called correctly."
2009-10-10 09:35:16 +00:00
Robert Osfield
431290c04e From Cedric Pinson, fix crash without error messages if the example does find the nathan.osg file. 2009-07-16 11:49:37 +00:00
Robert Osfield
22e4e63060 From Gary Quinn, spelling fixes 2009-02-06 15:17:49 +00:00
Robert Osfield
418dc34776 Fixed warnings 2009-01-07 11:24:47 +00:00
Robert Osfield
ffe77a785a Build fixes for when the implict ref_ptr<> cast is not enabled 2008-12-16 20:49:12 +00:00
Robert Osfield
60fc821764 From Cedric Pinson and Jeremey Moles, Changes to OpenSceneGraph-osgWidget-dev branch.
Notes from Robert Osfield, Merged changes to OpenSceneGraph-osgWidget-dev r9367 (prior to my botched attempt at merged svn/trunk into the branch).
2008-12-16 20:29:00 +00:00
Robert Osfield
56a2cc65d0 From Cedric Pinson, Pulled in osgAnimation from OpenSceneGraph-osgWidget-dev into svn/trunk. 2008-11-22 12:14:19 +00:00