![]() |
wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
|
Manages graphical assets such as fonts for reuse across the application. More...
#include <wAssetManager.hpp>
Public Member Functions | |
AssetManager ()=default | |
AssetManager (const AssetManager &)=delete | |
AssetManager & | operator= (const AssetManager &)=delete |
~AssetManager ()=default | |
void | LoadFont (const std::string &name, const std::string &fileName) |
Loads a font from file and stores it under a given name. | |
sf::Font & | getFont (const std::string &name) |
Retrieves a reference to a previously loaded font. | |
void | RemoveFont (const std::string &name) |
Removes a previously loaded font from memory. | |
void | debugPrintFonts () const |
Prints the list of loaded fonts to standard output. |
Manages graphical assets such as fonts for reuse across the application.
This class provides a centralized way to load, access, and manage graphical assets, currently supporting fonts via SFML. Assets are identified by string keys and stored internally to avoid reloading them multiple times.
This manager is non-copyable to ensure centralized ownership and avoid accidental duplication of resources.
|
default |
|
delete |
|
default |
|
delete |
void wEngine::AssetManager::LoadFont | ( | const std::string & | name, |
const std::string & | fileName ) |
Loads a font from file and stores it under a given name.
If successful, the font is stored under the given name and can later be retrieved with getFont( name ). If loading fails, an exception is thrown.
name | The unique name used to identify the font. |
fileName | The path to the font file on disk. |
std::runtime_error | if the font cannot be loaded from file. |
sf::Font & wEngine::AssetManager::getFont | ( | const std::string & | name | ) |
Retrieves a reference to a previously loaded font.
name | The name of the font previously loaded. |
std::runtime_error | if the font does not exist. |
void wEngine::AssetManager::RemoveFont | ( | const std::string & | name | ) |
Removes a previously loaded font from memory.
name | The name of the font to remove. |
std::runtime_error | if the font does not exist. |
void wEngine::AssetManager::debugPrintFonts | ( | ) | const |
Prints the list of loaded fonts to standard output.