14#ifndef OSGDB_SHAREDSTATEMANAGER
15#define OSGDB_SHAREDSTATEMANAGER 1
23#include <OpenThreads/Mutex>
53 void setShareMode(
unsigned int mode);
107 return lhs->compare(*rhs,
true) < 0;
The osgDB library provides support for reading and writing scene graphs, providing a plugin framework...
Definition Archive:24
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
DataVariance
Definition Object:217
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
Texture pure virtual base class that encapsulates OpenGL texture functionality common to the various ...
Definition Texture:422
StateSetStateSetSharePairMap tmpSharedStateSetList
Definition SharedStateManager:125
bool _shareStateSet[3]
Definition SharedStateManager:129
ShareMode
Definition SharedStateManager:35
@ SHARE_UNSPECIFIED_STATESETS
Definition SharedStateManager:41
@ SHARE_STATIC_TEXTURES
Definition SharedStateManager:37
@ SHARE_STATESETS
Definition SharedStateManager:44
@ SHARE_STATIC_STATESETS
Definition SharedStateManager:40
@ SHARE_TEXTURES
Definition SharedStateManager:43
@ SHARE_ALL
Definition SharedStateManager:45
@ SHARE_NONE
Definition SharedStateManager:36
@ SHARE_DYNAMIC_STATESETS
Definition SharedStateManager:42
@ SHARE_UNSPECIFIED_TEXTURES
Definition SharedStateManager:38
@ SHARE_DYNAMIC_TEXTURES
Definition SharedStateManager:39
META_NodeVisitor(osgDB, SharedStateManager) void setShareMode(unsigned int mode)
std::pair< osg::StateAttribute *, bool > TextureSharePair
Definition SharedStateManager:119
void process(osg::StateSet *ss, osg::Object *parent)
bool shareStateSet(osg::Object::DataVariance variance)
Definition SharedStateManager:81
TextureTextureSharePairMap tmpSharedTextureList
Definition SharedStateManager:121
TextureSet _sharedTextureList
Definition SharedStateManager:113
osg::StateAttribute * find(osg::StateAttribute *sa)
bool shareTexture(osg::Object::DataVariance variance)
Definition SharedStateManager:76
osg::StateSet * find(osg::StateSet *ss)
StateSetSet _sharedStateSetList
Definition SharedStateManager:116
bool isShared(osg::StateSet *stateSet)
bool _shareTexture[3]
Definition SharedStateManager:128
unsigned int getShareMode()
Definition SharedStateManager:55
OpenThreads::Mutex _listMutex
Definition SharedStateManager:135
OpenThreads::Mutex * _mutex
Definition SharedStateManager:133
bool isShared(osg::Texture *texture)
void setStateSet(osg::StateSet *ss, osg::Object *object)
std::pair< osg::StateSet *, bool > StateSetSharePair
Definition SharedStateManager:123
void releaseGLObjects(osg::State *state) const
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics...
unsigned int _shareMode
Definition SharedStateManager:127
void share(osg::Node *node, OpenThreads::Mutex *mt=0)
std::set< osg::ref_ptr< osg::StateSet >, CompareStateSets > StateSetSet
Definition SharedStateManager:115
std::set< osg::ref_ptr< osg::StateAttribute >, CompareStateAttributes > TextureSet
Definition SharedStateManager:112
std::map< osg::StateAttribute *, TextureSharePair > TextureTextureSharePairMap
Definition SharedStateManager:120
void shareTextures(osg::StateSet *ss)
std::map< osg::StateSet *, StateSetSharePair > StateSetStateSetSharePairMap
Definition SharedStateManager:124
SharedStateManager(unsigned int mode=SHARE_ALL)
void apply(osg::Node &node)
Definition SharedStateManager:94
bool operator()(const osg::ref_ptr< osg::StateAttribute > &lhs, const osg::ref_ptr< osg::StateAttribute > &rhs) const
Definition SharedStateManager:95
Definition SharedStateManager:103
bool operator()(const osg::ref_ptr< osg::StateSet > &lhs, const osg::ref_ptr< osg::StateSet > &rhs) const
Definition SharedStateManager:104
#define OSGDB_EXPORT
Definition Export:39