14 #ifndef OSGDB_SHAREDSTATEMANAGER
15 #define OSGDB_SHAREDSTATEMANAGER 1
18 #include <osg/NodeVisitor>
21 #include <osgDB/Export>
23 #include <OpenThreads/Mutex>
37 SHARE_STATIC_TEXTURES = 1<<0,
38 SHARE_UNSPECIFIED_TEXTURES = 1<<1,
39 SHARE_DYNAMIC_TEXTURES = 1<<2,
40 SHARE_STATIC_STATESETS = 1<<3,
41 SHARE_UNSPECIFIED_STATESETS = 1<<4,
42 SHARE_DYNAMIC_STATESETS = 1<<5,
43 SHARE_TEXTURES = SHARE_STATIC_TEXTURES | SHARE_UNSPECIFIED_TEXTURES,
44 SHARE_STATESETS = SHARE_STATIC_STATESETS | SHARE_UNSPECIFIED_STATESETS,
45 SHARE_ALL = SHARE_TEXTURES |
53 void setShareMode(
unsigned int mode);
55 unsigned int getShareMode() {
return _shareMode; }
73 void releaseGLObjects(
osg::State* state )
const;
79 return _shareTexture[variance];
84 return _shareStateSet[variance];
108 return lhs->
compare(*rhs,
true) < 0;
129 bool _shareTexture[3];
130 bool _shareStateSet[3];
std::set< osg::ref_ptr< osg::StateAttribute >, CompareStateAttributes > TextureSet
TextureSet _sharedTextureList
This class provides an object-oriented thread mutex interface.
OpenThreads::Mutex _listMutex
std::pair< osg::StateSet *, bool > StateSetSharePair
std::pair< osg::StateAttribute *, bool > TextureSharePair
StateSetSet _sharedStateSetList
bool operator()(const osg::ref_ptr< osg::StateSet > &lhs, const osg::ref_ptr< osg::StateSet > &rhs) const
TextureTextureSharePairMap tmpSharedTextureList
std::map< osg::StateAttribute *, TextureSharePair > TextureTextureSharePairMap
OpenThreads::Mutex * _mutex
std::set< osg::ref_ptr< osg::StateSet >, CompareStateSets > StateSetSet
typedef void(GL_APIENTRY *GLTexImage3DProc)(GLenum target
bool shareTexture(osg::Object::DataVariance variance)
std::map< osg::StateSet *, StateSetSharePair > StateSetStateSetSharePairMap
#define META_NodeVisitor(library, name)
bool operator()(const osg::ref_ptr< osg::StateAttribute > &lhs, const osg::ref_ptr< osg::StateAttribute > &rhs) const
bool shareStateSet(osg::Object::DataVariance variance)
StateSetStateSetSharePairMap tmpSharedStateSetList
int compare(const StateSet &rhs, bool compareAttributeContents=false) const