Commit Graph

25 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
485709f708 Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object.
Moved the #defines into new include/osg/GLDefines
Converted all GL2Extensions usage to GLExtensions usage


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14593 16af8721-9629-0410-8352-f15c8da7e697
2014-12-10 10:38:12 +00:00
Robert Osfield
d02c0bdc49 Moved GLBufferObject::Extensions structure into osg::GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14570 16af8721-9629-0410-8352-f15c8da7e697
2014-12-04 18:13:11 +00:00
Robert Osfield
69407f4054 Removed redundent spaces
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14569 16af8721-9629-0410-8352-f15c8da7e697
2014-12-04 18:12:07 +00:00
Robert Osfield
6d66e1abaa Added support for using GL_UNPACK_ROW_LENGTH in conjunction with texture's + osg::Image via new RowLength
parameter in osg::Image.  To support this Image::setData(..) now has a new optional rowLength parameter which
defaults to 0, which provides the original behaviour, Image::setRowLength(int) and int Image::getRowLength() are also provided.

With the introduction of RowLength support in osg::Image it is now possible to create a sub image where
the t size of the image are smaller than the row length, useful for when you have a large image on the CPU
and which to use a small portion of it on the GPU.  However, when these sub images are created the data
within the image is no longer contiguous so data access can no longer assume that all the data is in
one block.  The new method Image::isDataContiguous() enables the user to check whether the data is contiguous,
and if not one can either access the data row by row using Image::data(column,row,image) accessor, or use the
new Image::DataIterator for stepping through each block on memory assocatied with the image.

To support the possibility of non contiguous osg::Image usage of image objects has had to be updated to
check DataContiguous and handle the case or use access via the DataIerator or by row by row.  To achieve
this a relatively large number of files has had to be modified, in particular the texture classes and
image plugins that doing writing.
2012-01-24 14:34:02 +00:00
Robert Osfield
9b70348ced Fixed typo of commercial 2010-11-22 11:22:03 +00:00
Robert Osfield
f75013d534 Introduced new BufferObject design + implementation in preperation of implementing a pool system for buffer objects 2009-10-01 20:19:42 +00:00
Robert Osfield
9996e565ba From Paul Martz, "Looks like the people who created these two examples were a bit careless with cut and paste." 2009-04-22 10:54:11 +00:00
Robert Osfield
315aeeb557 Where possible moved redundent C header includes from headers to source files 2008-12-12 18:47:30 +00:00
Robert Osfield
20e6ec7b23 From Jean-Sebastien Guay, "The new osgscreencapture example was being installed to bin instead of to share/OpenSceneGraph/bin, this is because the CMakeLists.txt used SETUP_APPLICATION instead of SETUP_EXAMPLE. Corrected CMakeLists.txt attached.
"
2008-06-06 16:45:07 +00:00
Robert Osfield
7592e50cde Introduce --pbuffer-only width height option, and added fps reporting to stats output 2008-05-26 16:25:31 +00:00
Robert Osfield
57ce3f820e Added basic --pbuffer width height support 2008-05-26 15:41:54 +00:00
Robert Osfield
7aac7ef381 Added better stats reporting 2008-05-26 14:30:48 +00:00
Robert Osfield
bb1f6ff7c1 Added feedback of pixel format chosen for read back 2008-05-26 12:01:24 +00:00
Robert Osfield
8ed9b303f1 Added automatic selection of the pixel type according to the window type 2008-05-26 11:59:25 +00:00
Robert Osfield
d2afe3e956 Added option for doing triple buffering, and set the default read format
to GL_RGBA
2008-05-26 11:53:51 +00:00
Robert Osfield
dc7db11e63 Switch to using an inital draw callback when use --start-frame 2008-05-25 22:06:41 +00:00
Robert Osfield
5664c51cf0 Added option for setting whether the front or back buffer should be read using
--front and --back command line options.
2008-05-25 21:52:32 +00:00
Robert Osfield
28fd4b07c9 Added option for controlling whether the front buffer is read at the start of the
frame or the back buffer at the end of the frame.
2008-05-25 21:35:39 +00:00
Robert Osfield
cc07d064bf Changed default format to GL_BGR 2008-05-24 08:13:55 +00:00
Robert Osfield
90308d22aa Added single buffered and double buffered PBO support, and --no-pbo,
--single-pbo and --double-pbo command line parameters
2008-05-23 16:26:03 +00:00
Robert Osfield
f9f1aab67d Added basic glReadPixels code 2008-05-22 17:50:22 +00:00
Robert Osfield
fd76054eac Added camera final callback attachment code. 2008-05-22 15:43:01 +00:00
Robert Osfield
0a3737eb2c Fixed name of source file 2008-05-22 13:11:23 +00:00
Robert Osfield
29d067639c Added new osgscreencapture example folder, implementation to follow 2008-05-22 13:10:40 +00:00