35 #ifndef IECOREGL_STATE_H
36 #define IECOREGL_STATE_H
38 #include "IECore/CompoundData.h"
40 #include "IECoreGL/Export.h"
41 #include "IECoreGL/Bindable.h"
42 #include "IECoreGL/TypeIds.h"
47 IE_CORE_FORWARDDECLARE( State );
48 IE_CORE_FORWARDDECLARE( StateComponent );
50 class IECOREGL_API State :
public Bindable
67 ScopedBinding(
const State &s, State ¤tState,
bool bind );
74 void init(
const State &s,
bool bind =
true );
76 State &m_currentState;
77 std::vector<StateComponentPtr> m_savedComponents;
81 State(
bool complete );
82 State(
const State &other );
86 IE_CORE_DECLARERUNTIMETYPEDEXTENSION( IECoreGL::State, StateTypeId,
Bindable );
89 void bind()
const override;
93 void add( StatePtr s );
100 void add( StateComponentPtr s,
bool override =
false );
104 const T *
get()
const;
107 template<
typename T>
void remove();
110 bool isComplete()
const;
116 typedef StateComponentPtr (*CreatorFn)();
121 static const State *defaultState();
137 static void bindBaseState();
141 IE_CORE_FORWARDDECLARE( Implementation )
142 ImplementationPtr m_implementation;
144 typedef
std::map<
IECore::TypeId, CreatorFn> CreatorMap;
145 static CreatorMap *creators();
151 #include "IECoreGL/State.inl"
153 #endif // IECOREGL_STATE_H
Definition: StateComponent.h:51
The namespace within which all CoreGL functionality is defined.
Definition: AlphaTexture.h:41
Definition: MStringLess.h:40
Definition: CompoundData.h:47
TypeId
Definition: TypeIds.h:46
Definition: Bindable.h:49
IECOREGL_API void init(bool glAlreadyInitialised=false)
This namespace contains all components of the core library.
Definition: AddSmoothSkinningInfluencesOp.h:43