Torque2D Reference
|
#include <resourceManager.h>
Public Member Functions | |
ResourceInstance () | |
virtual | ~ResourceInstance () |
Public Attributes | |
ResourceObject * | mSourceResource |
Pointer to the ResourceObject that stores all our book-keeping data. More... | |
The base class for all resources.
This must be subclassed to implement a resource that can be managed.
Creating a new resource type is very simple. First, you need a function which can create a new instance of the resource given a stream:
Then you need to register the extension of your resource type with the resource manager:
And, of course, you need to provide a subclass of ResourceInstance:
ResourceInstance imposes very few requirements on you as the resource type implementor. All you "have" to provide is a destructor to deallocate whatever storage your resource might allocate. The ResourceManager will ensure that there is only one instance of the ResourceInstance for each file, and that it is only destroyed when no more references to it remain.
|
inline |
|
inlinevirtual |
ResourceObject* mSourceResource |
Pointer to the ResourceObject that stores all our book-keeping data.