![]() |
OGRE
2.1.0unstable
Object-Oriented Graphics Rendering Engine
|
HLMS stands for "High Level Material System". More...
#include <OgreHlmsManager.h>
Public Types | |
typedef vector< uint16 >::type | BlockIdxVec |
typedef std::map< IdString, HlmsDatablock * > | HlmsDatablockMap |
typedef map< String, String >::type | ResourceToTexExtensionMap |
Public Member Functions | |
HlmsManager () | |
virtual | ~HlmsManager () |
uint8 | _addInputLayoutId (VertexElement2VecVec vertexElements, OperationType opType) |
void | _changeRenderSystem (RenderSystem *newRs) |
void | _datablockAdded (HlmsDatablock *datablock) |
Internal function used by Hlms types to tell us a datablock has been created so that we can return it when the user calls . More... | |
void | _datablockDestroyed (IdString name) |
Internal function to inform us that the datablock with the input name has been destroyed. More... | |
const BlockIdxVec & | _getActiveBlocksIndices (const HlmsBasicBlock &blockType) const |
Gets the indices of active blocks. More... | |
const HlmsBlendblock * | _getBlendblock (uint16 idx) const |
Gets a blendblock based on its index. More... | |
BasicBlock const *const * | _getBlocks (const HlmsBasicBlock &blockType) const |
Gets all blocks of a given type. More... | |
const HlmsMacroblock * | _getMacroblock (uint16 idx) const |
Gets a macroblock based on its index. More... | |
const HlmsSamplerblock * | _getSamplerblock (uint16 idx) const |
Gets a samplerblock based on its index. More... | |
void | _notifyV1InputLayoutDestroyed (uint8 v1LayoutId) |
void | _removeInputLayoutIdReference (uint8 layoutId) |
void | addReference (const BasicBlock *block) |
Increments the reference count for the block, despite being const. More... | |
void | destroyBlendblock (const HlmsBlendblock *Blendblock) |
destroyMacroblock More... | |
void | destroyMacroblock (const HlmsMacroblock *macroblock) |
Destroys a macroblock created by . More... | |
void | destroySamplerblock (const HlmsSamplerblock *Samplerblock) |
destroyMacroblock More... | |
const HlmsBlendblock * | getBlendblock (const HlmsBlendblock &baseParams) |
getMacroblock. More... | |
HlmsCompute * | getComputeHlms (void) |
HlmsDatablock * | getDatablock (IdString name) const |
Retrieves an exisiting datablock (i.e. More... | |
HlmsDatablock * | getDatablockNoDefault (IdString name) const |
getDatablock. More... | |
const HlmsDatablockMap & | getDatablocks (void) const |
Returns all registered datablocks. More... | |
HlmsDatablock * | getDefaultDatablock (void) const |
Datablock to use when another datablock failed or none was specified. More... | |
Hlms * | getHlms (HlmsTypes type) |
Returns a registered HLMS based on type. May be null. More... | |
Hlms * | getHlms (IdString name) |
Returns a registered HLMS based on name. May be null. More... | |
virtual Real | getLoadingOrder (void) const |
Gets the relative loading order of scripts of this type. More... | |
const HlmsMacroblock * | getMacroblock (const HlmsMacroblock &baseParams) |
Creates a macroblock that matches the same parameter as the input. More... | |
HlmsDatablock * | getMaterial (IdString name) const |
Alias function. More... | |
const HlmsSamplerblock * | getSamplerblock (HlmsSamplerblock baseParams) |
getMacroblock. More... | |
virtual const StringVector & | getScriptPatterns (void) const |
Gets the file patterns which should be used to find scripts for this class. More... | |
bool | getShadowMappingUseBackFaces (void) |
HlmsTextureManager * | getTextureManager (void) const |
void | loadMaterials (const String &filename, const String &groupName, HlmsJsonListener *listener, const String &additionalTextureExtension) |
Opens a file containing a JSON string to load all Hlms materials from. More... | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info More... | |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
void * | operator new[] (size_t sz) |
virtual void | parseScript (DataStreamPtr &stream, const String &groupName) |
Parse a script file. More... | |
void | registerComputeHlms (HlmsCompute *provider) |
void | registerHlms (Hlms *provider, bool deleteOnExit=true) |
Registers an HLMS provider. More... | |
void | saveMaterial (const HlmsDatablock *datablock, const String &filename, HlmsJsonListener *listener, const String &additionalTextureExtension) |
Saves a specific Hlms material at the given file location. More... | |
void | saveMaterials (HlmsTypes hlmsType, const String &filename, HlmsJsonListener *listener, const String &additionalTextureExtension) |
Saves all materials of the registered Hlms at the given file location. More... | |
void | setShadowMappingUseBackFaces (bool useBackFaces) |
Sets whether or not shadow casters should be rendered into shadow textures using their back faces rather than their front faces. More... | |
void | unregisterComputeHlms (void) |
void | unregisterHlms (HlmsTypes type) |
Unregisters an HLMS provider of the given type. More... | |
void | useDefaultDatablockFrom (HlmsTypes type) |
Public Attributes | |
ResourceToTexExtensionMap | mAdditionalTextureExtensionsPerGroup |
HlmsJsonListener * | mJsonListener |
HLMS stands for "High Level Material System".
typedef vector<uint16>::type Ogre::HlmsManager::BlockIdxVec |
typedef std::map<IdString, HlmsDatablock*> Ogre::HlmsManager::HlmsDatablockMap |
typedef map<String, String>::type Ogre::HlmsManager::ResourceToTexExtensionMap |
Ogre::HlmsManager::HlmsManager | ( | ) |
|
virtual |
uint8 Ogre::HlmsManager::_addInputLayoutId | ( | VertexElement2VecVec | vertexElements, |
OperationType | opType | ||
) |
void Ogre::HlmsManager::_changeRenderSystem | ( | RenderSystem * | newRs | ) |
void Ogre::HlmsManager::_datablockAdded | ( | HlmsDatablock * | datablock | ) |
Internal function used by Hlms types to tell us a datablock has been created so that we can return it when the user calls .
void Ogre::HlmsManager::_datablockDestroyed | ( | IdString | name | ) |
Internal function to inform us that the datablock with the input name has been destroyed.
const BlockIdxVec& Ogre::HlmsManager::_getActiveBlocksIndices | ( | const HlmsBasicBlock & | blockType | ) | const |
Gets the indices of active blocks.
const HlmsBlendblock* Ogre::HlmsManager::_getBlendblock | ( | uint16 | idx | ) | const |
Gets a blendblock based on its index.
BasicBlock const* const* Ogre::HlmsManager::_getBlocks | ( | const HlmsBasicBlock & | blockType | ) | const |
Gets all blocks of a given type.
This is an advanced function useful in retrieving all the Macroblocks, all the Blendblocks, and all the Samplerblocks currently in use. Example: Get all macroblocks: const BlockIdxVec &activeMacroblockIdx = mgr->_getActiveBlocksIndices( BLOCK_MACRO ); BasicBlock const * const macroblocks = mgr->_getBlocks( BLOCK_MACRO ); BlockIdxVec::const_iterator itor = activeMacroblockIdx.begin(); BlockIdxVec::const_iterator end = activeMacroblockIdx.end(); while( itor != end ) { const HlmsMacroblock *macroblock = static_cast<const HlmsMacroblock>( macroblocks[*itor] ); ++itor; }
const HlmsMacroblock* Ogre::HlmsManager::_getMacroblock | ( | uint16 | idx | ) | const |
Gets a macroblock based on its index.
const HlmsSamplerblock* Ogre::HlmsManager::_getSamplerblock | ( | uint16 | idx | ) | const |
Gets a samplerblock based on its index.
void Ogre::HlmsManager::_notifyV1InputLayoutDestroyed | ( | uint8 | v1LayoutId | ) |
void Ogre::HlmsManager::_removeInputLayoutIdReference | ( | uint8 | layoutId | ) |
void Ogre::HlmsManager::addReference | ( | const BasicBlock * | block | ) |
Increments the reference count for the block, despite being const.
void Ogre::HlmsManager::destroyBlendblock | ( | const HlmsBlendblock * | Blendblock | ) |
destroyMacroblock
void Ogre::HlmsManager::destroyMacroblock | ( | const HlmsMacroblock * | macroblock | ) |
Destroys a macroblock created by .
Blocks are manually reference counted and calling this function will decrease the count. The object will actually be destroyed when the count reaches 0. When count reaches 0, it will perform an O(N) search but N <= OGRE_HLMS_NUM_MACROBLOCKS
void Ogre::HlmsManager::destroySamplerblock | ( | const HlmsSamplerblock * | Samplerblock | ) |
destroyMacroblock
const HlmsBlendblock* Ogre::HlmsManager::getBlendblock | ( | const HlmsBlendblock & | baseParams | ) |
getMacroblock.
This is the same for blend states The block's reference count will be increased. Use destroyBlendblock to decrease it.
|
inline |
HlmsDatablock* Ogre::HlmsManager::getDatablock | ( | IdString | name | ) | const |
Retrieves an exisiting datablock (i.e.
material) based on its name, regardless of which HLMS type it belongs to.
name | Unique name of the datablock. Datablock names are unique within the same Hlms type. If two types create a datablock with the same name and both attempt to make it globally visible to this manager, we will throw on creation. |
HlmsDatablock* Ogre::HlmsManager::getDatablockNoDefault | ( | IdString | name | ) | const |
getDatablock.
Exactly the same, but returns null pointer if it wasn't found, instead of going fallback to default.
|
inline |
Returns all registered datablocks.
HlmsDatablock* Ogre::HlmsManager::getDefaultDatablock | ( | void | ) | const |
Datablock to use when another datablock failed or none was specified.
Returns a registered HLMS based on type. May be null.
Returns a registered HLMS based on name. May be null.
|
virtual |
Gets the relative loading order of scripts of this type.
Implements Ogre::ScriptLoader.
const HlmsMacroblock* Ogre::HlmsManager::getMacroblock | ( | const HlmsMacroblock & | baseParams | ) |
Creates a macroblock that matches the same parameter as the input.
If it already exists, returns the existing one.
baseParams | A macroblock reference to base the parameters. This reference may live on the stack, on the heap, etc; it's RS-specific data does not have to be filled. e.g. this is fine: HlmsMacroblock myRef; myRef.mDepthCheck = false; HlmsMacroblock *finalBlock = manager->getMacroblock( myRef ); myRef.mRsData == finalBlock.mRsData not necessarily true |
|
inline |
Alias function.
getDatablock, as many beginners will probably think of the word "Material" first. Datablock is a more technical (and accurate) name of what it does (it's a block.. of data). Prefer calling getDatablock directly.
const HlmsSamplerblock* Ogre::HlmsManager::getSamplerblock | ( | HlmsSamplerblock | baseParams | ) |
getMacroblock.
This is the same for Sampler states
|
inlinevirtual |
Gets the file patterns which should be used to find scripts for this class.
Implements Ogre::ScriptLoader.
|
inline |
|
inline |
void Ogre::HlmsManager::loadMaterials | ( | const String & | filename, |
const String & | groupName, | ||
HlmsJsonListener * | listener, | ||
const String & | additionalTextureExtension | ||
) |
Opens a file containing a JSON string to load all Hlms materials from.
filename | |
groupName |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
|
inlineinherited |
placement operator new
|
inlineinherited |
array operator new, with debug line info
|
inlineinherited |
|
virtual |
Parse a script file.
stream | Weak reference to a data stream which is the source of the script |
groupName | The name of a resource group which should be used if any resources are created during the parse of this script. |
Implements Ogre::ScriptLoader.
void Ogre::HlmsManager::registerComputeHlms | ( | HlmsCompute * | provider | ) |
void Ogre::HlmsManager::registerHlms | ( | Hlms * | provider, |
bool | deleteOnExit = true |
||
) |
Registers an HLMS provider.
The type is retrieved from the provider. Two providers of the same type cannot be registered at the same time (
provider | The HLMS provider being registered. |
deleteOnExit | True if we should delete the pointer using OGRE_DELETE when the provider is unregistered or when this manager is destroyed. Otherwise it's caller's responsability to free the pointer. |
void Ogre::HlmsManager::saveMaterial | ( | const HlmsDatablock * | datablock, |
const String & | filename, | ||
HlmsJsonListener * | listener, | ||
const String & | additionalTextureExtension | ||
) |
Saves a specific Hlms material at the given file location.
datablock | Datablock/Material to save |
filename | Valid file path. |
void Ogre::HlmsManager::saveMaterials | ( | HlmsTypes | hlmsType, |
const String & | filename, | ||
HlmsJsonListener * | listener, | ||
const String & | additionalTextureExtension | ||
) |
void Ogre::HlmsManager::setShadowMappingUseBackFaces | ( | bool | useBackFaces | ) |
Sets whether or not shadow casters should be rendered into shadow textures using their back faces rather than their front faces.
void Ogre::HlmsManager::unregisterComputeHlms | ( | void | ) |
void Ogre::HlmsManager::unregisterHlms | ( | HlmsTypes | type | ) |
Unregisters an HLMS provider of the given type.
Does nothing if no provider was registered. registerHlms for details.
|
inline |
ResourceToTexExtensionMap Ogre::HlmsManager::mAdditionalTextureExtensionsPerGroup |
HlmsJsonListener* Ogre::HlmsManager::mJsonListener |