Manages resources used by the application.
More...
#include <ResourceManager.hpp>
Manages resources used by the application.
template<typename ResT , typename... Path>
auto chesspp::res::ResourceManager::from_config |
( |
Path const &... |
path | ) |
-> typename std::enable_if
<
std::is_base_of<Resource, ResT>::value,
ResT &
>::type
|
|
inline |
Obtains a resource for a config setting, constructing it if it does not yet exist.
Example invocation:
using Font_res = res::SfmlFileResource<sf::Font>;
ResourceManager &resmanager = blah;
Font_res &fontres = resmanager.from_config<Font_res>("menu", "font");
sf::Font font (fontres);
//...
- Template Parameters
-
ResT | The type of the Resource to construct or return. |
Path | deduced by the compiler from the argument list. |
- Parameters
-
- Returns
- a reference to the resource, of type ResT
The documentation for this class was generated from the following file: