rag
graphic 2d engine
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
rag::ResourceMgr Class Reference

Handles Resource management, including loading and unloading Resource instances. More...

#include <ResourceMgr.h>

Public Member Functions

void update ()
 Do the tasks for this frame. Must be called each frame.
 
ResourcegetResource (const std::string &name)
 Returns a resource by name. Will return a null pointer if the resource doesn't exists.
 
void loadResource (Resource *resource, bool inBackground=true)
 Starts loading a Resource. More...
 
void unload (const std::string &resourceName)
 Free memory allocated by a given Resource by name.
 
void reload ()
 On context lost.
 
void dumpResources (const std::string &extension="*")
 Display the Resource instances currently loaded in memory.
 
int numPendingResources ()
 Number of Resource instances waiting to be loaded.
 
void clean ()
 Cleans all Resources with no users.
 

Static Public Member Functions

static ResourceMgrinstance ()
 Returns the shared instance of the manager.
 

Public Attributes

int memoryWarnings
 For iOS, the number of memory warnings given by the OS.
 

Detailed Description

Handles Resource management, including loading and unloading Resource instances.

Member Function Documentation

void ResourceMgr::loadResource ( Resource resource,
bool  inBackground = true 
)

Starts loading a Resource.

The Resource can be loaded synchronous or asynchronously.

Parameters
inBackgroundIf true the Resource will be loaded in a background thread.

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