![]() |
xyginext
0.2.0
Second generation of xygine game creation framework
|
Abstract base class for resource management. More...
#include <Resource.hpp>
Public Member Functions | |
BaseResource (const BaseResource &)=delete | |
BaseResource (BaseResource &&)=delete | |
BaseResource & | operator= (const BaseResource &)=delete |
BaseResource & | operator= (BaseResource &&)=delete |
T & | get (const std::string &path="default") |
Attempts to load a resource from disk at the given path. More... | |
Protected Member Functions | |
virtual std::unique_ptr< T > | errorHandle ()=0 |
Function for handling resource acquisition errors. More... | |
Abstract base class for resource management.
The templated base class provides resource management for types given by derived classes. Resource management makes sure only a single instance of each resource, such as a texture or shader is loaded at a time.
|
protectedpure virtual |
Function for handling resource acquisition errors.
Concrete resource manager types must implement this to provide a fallback instance of the resource type, should loading of the requested resource fail for some reason.
|
inline |
Attempts to load a resource from disk at the given path.
If the resource is not found or fails to load the resource manager supplies a fallback resource, as defined by the concrete implementation of the resource manager.