Manages the loading, retrieval, and deletion of Texture objects.
More...
#include <TextureManager.h>
|
static Texture * | Get (const std::string &key) |
| Retrieves a Texture object by its key.
|
|
static void | Load (const std::string &key, const std::string &path) |
| Loads a Texture object from a file path.
|
|
static void | Load (const std::string &key, const unsigned char &red, const unsigned char &green, const unsigned char &blue) |
| Loads a single pixel Texture object with specified color.
|
|
|
| TextureManager (const TextureManager &)=delete |
|
TextureManager & | operator= (const TextureManager &)=delete |
|
void | privDelete () |
|
Texture * | privGet (const std::string &key) |
|
void | privLoad (const std::string &key, const std::string &path) |
|
void | privLoad (const std::string &key, const unsigned char &red, const unsigned char &green, const unsigned char &blue) |
|
|
static TextureManager & | Instance () |
|
static void | Delete () |
| Deletes all managed Texture objects.
|
|
|
const std::string | defaultPath |
| Default path for loading textures.
|
|
std::map< std::string, Texture * > | storageMap |
| Map storing Texture objects associated with their keys.
|
|
|
class | TextureManagerAttorney |
|
Manages the loading, retrieval, and deletion of Texture objects.
The TextureManager class is responsible for managing Texture objects, including loading textures from files, creating single pixel textures, retrieving textures by key, and deleting all managed textures. It follows the Singleton design pattern.
◆ Get()
static Texture * TextureManager::Get |
( |
const std::string & | key | ) |
|
|
inlinestatic |
Retrieves a Texture object by its key.
- Parameters
-
key | The key associated with the Texture object. |
- Returns
- A pointer to the Texture object, or nullptr if the key is not found.
◆ Load() [1/2]
static void TextureManager::Load |
( |
const std::string & | key, |
|
|
const std::string & | path ) |
|
inlinestatic |
Loads a Texture object from a file path.
- Parameters
-
key | The key to associate with the Texture object. |
path | The file path to load the texture from. |
◆ Load() [2/2]
static void TextureManager::Load |
( |
const std::string & | key, |
|
|
const unsigned char & | red, |
|
|
const unsigned char & | green, |
|
|
const unsigned char & | blue ) |
|
inlinestatic |
Loads a single pixel Texture object with specified color.
- Parameters
-
key | The key to associate with the Texture object. |
red | The red component of the color. |
green | The green component of the color. |
blue | The blue component of the color. |
The documentation for this class was generated from the following files: