This represents a unique collection of RenderEffect objects that correspond to a particular renderable state. More...
Public Member Functions | |
RenderEffects const | addEffect (RenderEffect const effect) |
Returns a new RenderEffects object that represents the same as the source state, with the new RenderEffect added. | |
int | findEffect (TypeHandle type) |
Searches for an effect with the indicated type in the state, and returns its index if it is found, or. | |
RenderEffect const | getEffect (TypeHandle type) |
Looks for a RenderEffect of the indicated type in the state, and returns it if it is found, or NULL if it is not. | |
RenderEffect const | getEffect (int n) |
Returns the nth effect in the state. | |
int | getNumEffects () |
Returns the number of separate effects indicated in the state. | |
bool | isEmpty () |
Returns true if the state is empty, false otherwise. | |
bool | operator< (RenderEffects const other) |
Provides an arbitrary ordering among all unique RenderEffects, so we can store the essentially different ones in a big set and throw away the rest. | |
output (ostream out) | |
RenderEffects const | removeEffect (TypeHandle type) |
Returns a new RenderEffects object that represents the same as the source state, with the indicated RenderEffect removed. | |
write (ostream out, int indent_level) | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
static int | getNumStates () |
Returns the total number of unique RenderEffects objects allocated in the world. | |
static | listStates (ostream out) |
Lists all of the RenderEffects in the cache to the output stream, one per line. | |
static RenderEffects const | make (RenderEffect const effect) |
Returns a RenderEffects with one effect set. | |
static RenderEffects const | make (RenderEffect const effect1, RenderEffect const effect2) |
Returns a RenderEffects with two effects set. | |
static RenderEffects const | make (RenderEffect const effect1, RenderEffect const effect2, RenderEffect const effect3) |
Returns a RenderEffects with three effects set. | |
static RenderEffects const | make (RenderEffect const effect1, RenderEffect const effect2, RenderEffect const effect3, RenderEffect const effect4) |
Returns a RenderEffects with four effects set. | |
static RenderEffects const | makeEmpty () |
Returns a RenderEffects with no effects set. | |
static bool | validateStates () |
Ensures that the cache is still stored in sorted order. |
This represents a unique collection of RenderEffect objects that correspond to a particular renderable state.
You should not attempt to create or modify a RenderEffects object directly. Instead, call one of the make() functions to create one for you. And instead of modifying a RenderEffects object, create a new one.
RenderEffects const addEffect | ( | RenderEffect const | effect | ) |
Returns a new RenderEffects object that represents the same as the source state, with the new RenderEffect added.
If there is already a RenderEffect with the same type, it is replaced.
int findEffect | ( | TypeHandle | type | ) |
Searches for an effect with the indicated type in the state, and returns its index if it is found, or.
-1 if it is not.
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from TypedWritableReferenceCount.
RenderEffect const getEffect | ( | TypeHandle | type | ) |
Looks for a RenderEffect of the indicated type in the state, and returns it if it is found, or NULL if it is not.
RenderEffect const getEffect | ( | int | n | ) |
Returns the nth effect in the state.
int getNumEffects | ( | ) |
Returns the number of separate effects indicated in the state.
static int getNumStates | ( | ) | [static] |
Returns the total number of unique RenderEffects objects allocated in the world.
This will go up and down during normal operations.
bool isEmpty | ( | ) |
Returns true if the state is empty, false otherwise.
static listStates | ( | ostream | out | ) | [static] |
Lists all of the RenderEffects in the cache to the output stream, one per line.
This can be quite a lot of output if the cache is large, so be prepared.
static RenderEffects const make | ( | RenderEffect const | effect | ) | [static] |
Returns a RenderEffects with one effect set.
static RenderEffects const make | ( | RenderEffect const | effect1, |
RenderEffect const | effect2 | ||
) | [static] |
Returns a RenderEffects with two effects set.
static RenderEffects const make | ( | RenderEffect const | effect1, |
RenderEffect const | effect2, | ||
RenderEffect const | effect3 | ||
) | [static] |
Returns a RenderEffects with three effects set.
static RenderEffects const make | ( | RenderEffect const | effect1, |
RenderEffect const | effect2, | ||
RenderEffect const | effect3, | ||
RenderEffect const | effect4 | ||
) | [static] |
Returns a RenderEffects with four effects set.
static RenderEffects const makeEmpty | ( | ) | [static] |
Returns a RenderEffects with no effects set.
bool operator< | ( | RenderEffects const | other | ) |
Provides an arbitrary ordering among all unique RenderEffects, so we can store the essentially different ones in a big set and throw away the rest.
This method is not needed outside of the RenderEffects class because all equivalent RenderEffects objects are guaranteed to share the same pointer; thus, a pointer comparison is always sufficient.
RenderEffects const removeEffect | ( | TypeHandle | type | ) |
Returns a new RenderEffects object that represents the same as the source state, with the indicated RenderEffect removed.
static bool validateStates | ( | ) | [static] |
Ensures that the cache is still stored in sorted order.
Returns true if so, false if there is a problem (which implies someone has modified one of the supposedly-const RenderEffects objects).