Commit Graph

24 Commits

Author SHA1 Message Date
Robert Osfield
b8e5f22cb7 Added virtual bool Texture::isDirty(contextID) method to help determine whether a GL texture object is likely to be out of date and needs updating 2018-02-13 12:01:57 +00: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
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
7b16ff5ae1 From Mathias Froehlich, Changed osg::TextureRectangle to use osg::Texutre::applyTexParameters() to take advantage of texture shadow extension settings for texture rectangle 2009-04-24 09:07:22 +00:00
Robert Osfield
77b98eb5f8 Removed the mutable from the _image variable 2008-04-23 20:49:19 +00:00
Robert Osfield
f4afa427a7 From Roland Smeenk, "Attached you will find a large set of small typo fixes (mainly in the comments)." 2007-12-10 17:30:18 +00:00
Robert Osfield
5e83ae4821 From Art Trevs, "Features of the patch are:
- Implementation of integer textures as in EXT_texture_integer

- setBorderColor(Vec4) changed to setBorderColor(Vec4d) to pass double values
as border color. (Probably we have to provide an overloading function to
still support Vec4f ?)

- new method Texture::getInternalFormatType() added. Gives information if the
internal format normalized, float, signed integer or unsigned integer. Can
help people to write better code ;-)

"

Futher changes to this submission by Robert Osfield, changed the dirty mipmap
flag into a buffer_value<> vector to ensure safe handling of multiple contexts.
2007-09-11 12:04:58 +00:00
Robert Osfield
174e3b3dc3 Fixed RenderToTexture bug which occured when the viewport dimensions where
different than the texture being written to.
2006-08-03 15:57:39 +00:00
Robert Osfield
f1c2694c17 Updated copyright years. 2006-07-18 15:21:48 +00:00
Robert Osfield
4915259878 Improved support for texture subload/render to texture in various Texture classes
and RenderStage.
2005-11-04 12:08:16 +00:00
Robert Osfield
4e69d46289 Further work on trying to get glGenerateMipMapEXT working in conjunction with
frame buffer objects.  Still don't work under Linux yet through :-|
2005-07-27 11:27:44 +00:00
Robert Osfield
678b22ce83 Updated Copyright notices to 1998-2005. 2005-04-14 21:41:28 +00:00
Robert Osfield
d6d764a729 From Terry Welsh, added copy texture support to TextureRectangle 2005-04-13 18:19:38 +00:00
Robert Osfield
d268cf46fa Renamed SG_LIBRARY and SG_EXPORT macro's to OSG_LIBRARY and OSG_EXPORT 2005-04-11 17:14:17 +00:00
Robert Osfield
117c791a3b Added osg::BufferObject and a made a number associated to accomodate this
new class. osg::BufferObject wraps up OpenGL pixel and array buffer objects.
Currently implementation is work in progress.
2005-02-09 10:39:45 +00:00
Robert Osfield
ee67127279 From Eric Hammil, typo and spelling fixes 2004-09-13 15:14:11 +00:00
Robert Osfield
bb5576bef8 Added support s/getImage(uint i) and getNumImages(). 2004-07-27 10:11:45 +00:00
Robert Osfield
0307463746 Added GL_TEXTURE_RECTANGLE define 2004-05-07 12:40:21 +00:00
Robert Osfield
9f6383f5dd Added TextureRectangle(Image*) contructor. 2004-03-09 14:59:33 +00:00
Robert Osfield
c8b8a81052 Changed StateAttribute::getAssociatedModes(std::vector<GLMode>&) across
to StateAttribute::getModeUsage(StateAttribute::ModeUsage&).
2004-03-03 15:38:22 +00:00
Robert Osfield
edce2211fa From Romano Magacho, fixes to handle the subloading from Image when the
internal format changes requiring a rebuild of the texture object.
2004-01-23 13:25:45 +00:00
Robert Osfield
0685c2a852 Added applyTexImage_subload() implemention into TextureRectangle class
to provide automatic support for texture subloading.
2003-08-18 19:36:50 +00:00
Don BURNS
15f88f35b2 *** empty log message *** 2003-06-24 15:40:09 +00:00
Robert Osfield
7af174fadb From Ulrich Hertlien, new osg::TextureRectangle class. 2003-04-07 13:20:53 +00:00