OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::ManualResourceLoader Class Referenceabstract

Interface describing a manual resource loader. More...

#include <OgreResource.h>

+ Inheritance diagram for Ogre::ManualResourceLoader:

Public Member Functions

 ManualResourceLoader ()
virtual ~ManualResourceLoader ()
virtual void loadResource (Resource *resource)=0
 Called when a resource wishes to prepare. More...
virtual void prepareResource (Resource *resource)
 Called when a resource wishes to load. More...

Detailed Description

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.
The loader must remain valid for the entire life of the resource, so that if need be it can be called upon to re-load the resource at any time.

Definition at line 514 of file OgreResource.h.

Constructor & Destructor Documentation

Ogre::ManualResourceLoader::ManualResourceLoader ( )

Definition at line 517 of file OgreResource.h.

virtual Ogre::ManualResourceLoader::~ManualResourceLoader ( )

Definition at line 518 of file OgreResource.h.

Member Function Documentation

virtual void Ogre::ManualResourceLoader::loadResource ( Resource resource)
pure virtual

Called when a resource wishes to prepare.

resourceThe resource which wishes to prepare

Implemented in Ogre::MeshManager, and Ogre::Font.

virtual void Ogre::ManualResourceLoader::prepareResource ( Resource resource)

Called when a resource wishes to load.

Note that this could get called in a background thread even in just a semithreaded ogre (OGRE_THREAD_SUPPORT==2). Thus, you must not access the rendersystem from this callback. Do that stuff in loadResource.

resourceThe resource which wishes to load

Definition at line 526 of file OgreResource.h.

The documentation for this class was generated from the following file: