Manages the loading, retrieval, and deletion of Image objects.
More...
#include <ImageManager.h>
|
static Image * | Get (MapKey key) |
| Retrieves an Image object by its key.
|
|
static void | Load (MapKey key, Texture *tex) |
| Loads an Image object from a Texture.
|
|
static void | Load (MapKey key, Texture *tex, Rect *r) |
| Loads an Image object from a Texture and a Rect.
|
|
|
static const MapKey | defaultImageKey = AssetDefaults::DefaultImageKey |
| Default key for the default image.
|
|
|
| ImageManager (const ImageManager &)=delete |
|
ImageManager & | operator= (const ImageManager &)=delete |
|
void | privDelete () |
|
Image * | privGet (MapKey key) |
|
void | privLoad (MapKey key, Texture *tex) |
|
void | privLoad (MapKey key, Texture *tex, Rect *r) |
|
|
static ImageManager & | Instance () |
|
static void | Delete () |
| Deletes all managed Image objects and the singleton instance.
|
|
|
std::map< MapKey, Image * > | storageMap |
| Map storing Image objects associated with their keys.
|
|
|
class | ImageManagerAttorney |
|
Manages the loading, retrieval, and deletion of Image objects.
The ImageManager class is responsible for managing Image objects, including loading images from textures, retrieving images by key, and deleting all managed images. It follows the Singleton design pattern.
◆ Get()
static Image * ImageManager::Get |
( |
MapKey | key | ) |
|
|
inlinestatic |
Retrieves an Image object by its key.
- Parameters
-
key | The key associated with the Image object. |
- Returns
- A pointer to the Image object, or nullptr if the key is not found.
◆ Load() [1/2]
static void ImageManager::Load |
( |
MapKey | key, |
|
|
Texture * | tex ) |
|
inlinestatic |
Loads an Image object from a Texture.
- Parameters
-
key | The key to associate with the Image object. |
tex | A pointer to the Texture object. |
◆ Load() [2/2]
static void ImageManager::Load |
( |
MapKey | key, |
|
|
Texture * | tex, |
|
|
Rect * | r ) |
|
inlinestatic |
Loads an Image object from a Texture and a Rect.
- Parameters
-
key | The key to associate with the Image object. |
tex | A pointer to the Texture object. |
r | A pointer to the Rect object defining the image region. |
The documentation for this class was generated from the following files: