OGRE 14.3
Object-Oriented Graphics Rendering Engine
|
Interface describing a manual resource loader. More...
#include <OgreResource.h>
Public Member Functions | |
ManualResourceLoader () | |
virtual | ~ManualResourceLoader () |
virtual void | loadResource (Resource *resource)=0 |
Called when a resource wishes to load instead of Resource::loadImpl. | |
virtual void | prepareResource (Resource *resource) |
Called when a resource wishes to prepare instead of Resource::prepareImpl. | |
Interface describing a manual resource loader.
Resources are usually loaded from files; however in some cases you want to be able to set the data up manually instead. This provides some problems, such as how to reload a Resource if it becomes unloaded for some reason, either because of memory constraints, or because a device fails and some or all of the data is lost.
This interface should be implemented by all classes which wish to provide manual data to a resource. They provide a pointer to themselves when defining the resource (via the appropriate ResourceManager), and will be called when the Resource tries to load. They should implement the loadResource method such that the Resource is in the end set up exactly as if it had loaded from a file, although the implementations will likely differ between subclasses of Resource, which is why no generic algorithm can be stated here.
|
inline |
|
inlinevirtual |
Called when a resource wishes to prepare instead of Resource::prepareImpl.
resource | The resource which wishes to prepare |
Called when a resource wishes to load instead of Resource::loadImpl.
resource | The resource which wishes to load |
Implemented in Ogre::Font.