Base template class, to be used as a base from which classes which have resources that can be controlled, such as textures and music, can be derived. Resource managed classes rely on a ResourceManager.
|ResourceManaged(||const std::||string ||&||name||)|
Initializing constructor, calls open with a filename/zipname.
Destructor, calls release.
|virtual void open(||const std::||string ||&||name||)|
Opens new resource via the associated ResourceManager.
Removes a reference to the resource, releasing if needed. Generally called by destructor, so should rarely be called.
|std::string getName() const|
Get the name associated with the resource.
Name of resource, or empty string if no resource is loaded.
Cleans up any unused resources of the type. (Ex. Image::cleanUp() will unload all images.)
|static void addResource(||const std::||string ||&||name,|
|const typename ResMgrT::||ResDescT ||&||desc||)|
Define a new named resource. (Ex. Image::addResource(“monkey”,”images/monkey.png”) would make it so that any attempts to load “monkey” would load the image images/monkey.png)
|name||Name to give to resource.|
|path||Path of resource data file.|
|static void addResource(||const typename ResMgrT::||ResDescT ||&||desc||)|
Define a new unaliased resource. (name == path). (Ex. Image::addResource(“images/monkey.png”) is essentially the same as Image::addResource(“images/monkey.png”,”images/monkey.png”)
Parameters:. path - Path of resource data file.