#include <Resource.h>
Public Member Functions | |
| BengResource (void) | |
| ~BengResource (void) | |
| T * | loadData (const char *filepath) |
| T * | getData (unsigned int index) |
| int | getSize (void) |
| void | clearData (void) |
Ideally, a resource will contain related items, such as all the sprites to one character. In fact, a BengResource<BengISprite> is used internally by the layer and drawing routines to define a tileset. Since the class is templated, the container can hold any type you wish. Your class will need to follow this skeleton in order to be compatible:
MyClass::MyClass(const char *filepath)
{
this->data_ = myLoadDataFunction(filepath);
if (!this->data_)
return;
data_->myInitializationFunctions();
}
MyClass::~MyClass(void)
{
if (this->data_);
myUnloadDataFunction(this->data_);
}
void *MyClassgetRawData(void)
{
return this->data_;
}
| BengResource< T >::BengResource | ( | void | ) | [inline] |
| BengResource< T >::~BengResource | ( | void | ) | [inline] |
| void BengResource< T >::clearData | ( | void | ) | [inline] |
| T* BengResource< T >::getData | ( | unsigned int | index | ) | [inline] |
| int BengResource< T >::getSize | ( | void | ) | [inline] |
| T* BengResource< T >::loadData | ( | const char * | filepath | ) | [inline] |
1.5.8