Commit Graph

11 Commits

Author SHA1 Message Date
Robert Osfield
5f34cddc31 Fixed unused parameter warning. 2016-06-08 11:38:40 +01:00
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
70b5297575 From Jannik Heller, typo fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14826 16af8721-9629-0410-8352-f15c8da7e697
2015-04-07 18:01:12 +00:00
Robert Osfield
1793466442 With assistance from Sukender, moved the depreacted osg::Geometry vertex indices and AttributeBinding definitions out into a separated namespace/class so to use
deprecated features you should now use deprecated_osg::Geometry in place of osg::Geometry.
2013-06-25 16:10:24 +00:00
Robert Osfield
df075ef9bb Cleaned up usage of BIND_PER_PRIMITIVE where possible. 2013-06-19 16:24:59 +00:00
Robert Osfield
2c2234d68b Improved the handling of command line parameters 2011-06-14 16:50:40 +00:00
Robert Osfield
1e886ce539 From Paul Melis, "While trying out the osgbrowser example (where I had forgotten to update
LD_LIBRARY_PATH so the XUL libs would be found) I noticed that although
the gecko plugin was found it could not be loaded. But this did not
trigger any visible warning/error message (at least not without INFO
notify level). Would you mind if we change the notify level for a
dlerror() to WARNING? This will also make it more explicit for the case
when a plugin isn't actually found, which seems to come up a lot for
novice users (e.g. no freetype on win32, so no freetype plugin, etc).
Also, the current error message is misleading ("Warning: Could not FIND
plugin to ...") because the it's not always a case of not finding the
plugin. I slightly enhanced the situation of not finding a plugin versus
finding it but not being able to load it.

Here's also a few fixes to some of the examples:
- osgfont: make usage help line more in line with the actual behaviour
- osgcompositeviewer: complain when no model file was provided
- osgmovie: don't include quicktime-dependent feature on Linux
- osgocclussionquery: comment addition (as I was surprised that lines
were being drawn in a function called createRandomTriangles())"
2009-02-08 15:56:35 +00:00
Robert Osfield
9b1445d5b9 Fixed warnings 2008-12-18 13:56:30 +00:00
Robert Osfield
3b4af26136 From Paul Martz, fixed get/set methods API 2008-02-27 11:43:58 +00:00
Robert Osfield
b222d4201c From Paul Martz, "The osgocclusionquery example contained some duplicate code that was also in the core OSG occlusion query code. This change removes the need for that." 2007-12-26 22:00:28 +00:00
Robert Osfield
4889342c4a From Paul Martz, Introduced osg::OcclusionQueryNode with support for OpenGL occlusion query extension 2007-12-21 14:45:16 +00:00