![]() |
VR-Forces Developer's Guide
|
Class that allows you to abstractly register effect texture types the effect texture types are client specific (cdb, regular effect textures, etc) and typically enums and hence map directly to ints (DtOsgEffectTextureController::EffectTextureType) When a type is registered, that type is mapped to an index and the internal 'index' is incremented Therefore, each type maps to an index The highest possible index is num of types registered less 1 This class is used in conjunction with DtIndirectTextureCollectionPolicy to install the correct indirect rendering shaders for the usage type (cdb, point features, etc) The need for this additional indirection is that the 'type' can be any number (or indeed not an enum/int at all) but the way indirect rendering works, is that effect textures need to be with a start index of 0, and monotonically increasing (both for internal code and shader). This class helps us to achieve this.
Public Member Functions | |
| DtIndirectEffectTexturesTemplate () | |
| ~DtIndirectEffectTexturesTemplate () | |
| void | registerType (int type) |
| bool | hasType (int type) const |
| int | numEffectTextures (void) const |
| int | indexForType (int type) const |
| int | typeForIndex (int index) const |
| bool | operator== (const DtIndirectEffectTexturesTemplate &rhs) const |
| bool | operator!= (const DtIndirectEffectTexturesTemplate &rhs) const |
Protected Attributes | |
| MapIntToInt | myTypeToIndex |
| MapIntToInt | myIndexToType |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const DtIndirectEffectTexturesTemplate &rhs) |
| makVrv::DtIndirectEffectTexturesTemplate::DtIndirectEffectTexturesTemplate | ( | ) |
constructor
| makVrv::DtIndirectEffectTexturesTemplate::~DtIndirectEffectTexturesTemplate | ( | ) |
destructor - non virtual since this class is not intended to be derived from
| void makVrv::DtIndirectEffectTexturesTemplate::registerType | ( | int | type | ) |
register a type of an effect texture
was this type registered here?
| int makVrv::DtIndirectEffectTexturesTemplate::numEffectTextures | ( | void | ) | const |
number of effect texture registered
get the index, given the type
get the type, given the index
| bool makVrv::DtIndirectEffectTexturesTemplate::operator== | ( | const DtIndirectEffectTexturesTemplate & | rhs | ) | const |
equality operator
| bool makVrv::DtIndirectEffectTexturesTemplate::operator!= | ( | const DtIndirectEffectTexturesTemplate & | rhs | ) | const |
inequality operator
|
friend |
<< operator (e.g. for debugging)
|
protected |
|
protected |