![]() |
rag
graphic 2d engine
|
Abstract class the represent a game Resource, typically something costly to loaded. More...
#include <ResourceMgr.h>
Public Types | |
enum | State { Enqueued = 0, LoadingInBackground, BackgroundLoaded, Ready } |
List of possible states for a Resource. | |
Public Member Functions | |
virtual void | loadInBackground ()=0 |
CPU intensive load goes here. | |
virtual void | loadSync ()=0 |
Load that must be synchronized with the main thread. | |
void | acquire () |
Prevents the Resource to be deleted until it's release()'d. | |
void | release () |
Releases the Resource, so it can be deleted. | |
Public Attributes | |
State | state |
Current state. | |
std::string | resourceName |
Resource unique name. Usually the file name. | |
int | memorySize |
Size of the Resource in memory measured in bytes. | |
Friends | |
class | ResourceMgr |
Abstract class the represent a game Resource, typically something costly to loaded.
Resources are treated as if they were memory and CPU intensive. There are methods to load asynchronously a Resource.