#include <OgreMaterialManager.h>
Inheritance diagram for Ogre::MaterialManager:
Public Methods | |
MaterialManager () | |
Default constructor. More... | |
virtual | ~MaterialManager () |
Default destructor. More... | |
Material * | add (const Material &mat) |
Adds a copy of a material created outside the MaterialManager to the master Material list. More... | |
Material * | getByHandle (int handle) |
Gets a pointer to a Material by it's numerical handle. More... | |
void | parseScript (DataChunk &chunk) |
Parses a Material script file passed as a chunk. More... | |
void | parseAllSources (const String &extension=".material") |
Parses all material script files in resource folders & archives. More... | |
Resource * | create (const String &name) |
Create implementation required by ResourceManager. More... | |
Material * | createDeferred (const String &name) |
Create implementation that creates a deferred-load Material, ie one that does not load any resources like texture files etc, and does not register itself with SceneManagers until it is actually used. More... | |
virtual void | setMemoryBudget (size_t bytes) |
Set a limit on the amount of memory this resource handler may use. More... | |
virtual void | load (Resource *res, int priority) |
Load a resource. More... | |
virtual void | unload (Resource *res) |
Unloads a Resource from the managed resources list, calling it's unload() method. More... | |
virtual void | unloadAndDestroyAll (void) |
Unloads all Resources from memory. More... | |
virtual Resource * | getByName (const String &name) |
Retrieves a pointer to a resource by name. More... | |
void | addSearchPath (const String &path) |
Adds a relative path to search for resources of this type. More... | |
void | addArchiveEx (const String &strName, const String &strDriverName) |
Adds an archive to the search path for this type of resource. More... | |
bool | _findResourceData (const String &filename, DataChunk &refChunk) |
Internal method, used for locating resource data in the file system / archives. More... | |
Static Public Methods | |
MaterialManager & | getSingleton (void) |
Override standard Singleton retrieval. More... | |
void | addCommonSearchPath (const String &path) |
Adds a relative search path for resources of ALL types. More... | |
void | addCommonArchiveEx (const String &strName, const String &strDriverName) |
Adds an archive to the search path for all resources. More... | |
std::set< String > | _getAllCommonNamesLike (const String &startPath, const String &extension) |
Returns a collection of files with the given extension in the common resource paths. More... | |
bool | _findCommonResourceData (const String &filename, DataChunk &refChunk) |
Internal method, used for locating common resource data in the file system / archives. More... | |
MaterialManager * | getSingletonPtr (void) |
Protected Types | |
typedef std::map< String, MATERIAL_ATTRIB_PARSER > | MatAttribParserList |
Keyword-mapped attribute parsers. More... | |
typedef std::map< String, TEXLAYER_ATTRIB_PARSER > | LayerAttribParserList |
Keyword-mapped attribute parsers. More... | |
typedef HashMap< int, Material * > | MaterialHandleList |
typedef HashMap< String, ArchiveEx *, _StringHash > | FileMap |
Protected Methods | |
void | parseNewTextureLayer (DataChunk &chunk, Material *pMat) |
void | parseAttrib (const String &line, Material *pMat) |
void | parseLayerAttrib (const String &line, Material *pMat, Material::TextureLayer *pLayer) |
void | checkUsage (void) |
Checks memory usage and pages out if required. More... | |
Protected Attributes | |
MatAttribParserList | mMatAttribParsers |
LayerAttribParserList | mLayerAttribParsers |
MaterialHandleList | mHandles |
Materials by handle. More... | |
FileMap | mArchiveFiles |
ResourceMap | mResources |
size_t | mMemoryBudget |
size_t | mMemoryUsage |
std::vector< ArchiveEx * > | mVFS |
Collection of searchable ArchiveEx classes (virtual file system) for this resource type. More... | |
Static Protected Attributes | |
FileMap | mCommonArchiveFiles |
std::vector< ArchiveEx * > | mCommonVFS |
Collection of searchable ArchiveEx classes (virtual file system) for all resource types. More... | |
MaterialManager * | ms_Singleton = 0 |
When loaded from a script, a Material is in an 'unloaded' state and only stores the settings required. It does not at that stage load any textures. This is because the material settings may be loaded 'en masse' from bulk material script files, but only a subset will actually be required.
Because this is a subclass of ResourceManager, any files loaded will be searched for in any path or archive added to the resource paths/archives. See ResourceManager for details.
For a definition of the material script format, see the Tutorials/MaterialScript.html file.
|
|
|
Keyword-mapped attribute parsers.
|
|
Keyword-mapped attribute parsers.
|
|
|
|
Default constructor.
|
|
Default destructor.
|
|
Internal method, used for locating common resource data in the file system / archives.
|
|
Internal method, used for locating resource data in the file system / archives.
|
|
Returns a collection of files with the given extension in the common resource paths.
|
|
Adds a copy of a material created outside the MaterialManager to the master Material list.
|
|
Adds an archive to the search path for this type of resource.
|
|
Adds an archive to the search path for all resources.
|
|
Adds a relative search path for resources of ALL types.
This method has the same effect as ResourceManager::addSearchPath, except that the path added applies to ALL resources, not just the one managed by the subclass in question. |
|
Adds a relative path to search for resources of this type.
|
|
Checks memory usage and pages out if required.
|
|
Create implementation required by ResourceManager.
Implements Ogre::ResourceManager. |
|
Create implementation that creates a deferred-load Material, ie one that does not load any resources like texture files etc, and does not register itself with SceneManagers until it is actually used.
|
|
Gets a pointer to a Material by it's numerical handle.
|
|
Retrieves a pointer to a resource by name.
|
|
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< MaterialManager >. |
|
|
|
Load a resource. Resources will be subclasses. Reimplemented in Ogre::TextureManager. |
|
Parses all material script files in resource folders & archives.
|
|
|
|
|
|
|
|
Parses a Material script file passed as a chunk.
|
|
Set a limit on the amount of memory this resource handler may use.
|
|
Unloads a Resource from the managed resources list, calling it's unload() method.
|
|
Unloads all Resources from memory.
Reimplemented in Ogre::D3D8TextureManager. |
|
|
|
|
|
Collection of searchable ArchiveEx classes (virtual file system) for all resource types.
|
|
Materials by handle.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Collection of searchable ArchiveEx classes (virtual file system) for this resource type.
|
Copyright © 2002 by The OGRE Team