Singleton para el manager de texturas. Más...
#include <resource_manager.h>
Métodos públicos | |
ResourceManager (const ResourceManager &other)=delete | |
ResourceManager & | operator= (const ResourceManager &other)=delete |
SDLTexture & | get_texture (const std::string &type, int id) |
Obtiene una textura. Más... | |
AnimationPack & | get_animation_pack (const std::string &type, int id) |
Devuelve un pack de animacion. Más... | |
SDLSprite & | get_sprite (const std::string &type, int id) |
Devuelve un sprite. Más... | |
TTF_Font * | get_font (int id) |
Devuelve una fuente de SDL. Más... | |
SDLBitmapFont & | get_bitmap_font (int id) |
SDLMusic & | get_music (int id) |
Devuelve un objeto SDLMusic. Más... | |
SDLSoundFx & | get_sound_fx (int id) |
Devuelve un objeto SDLSoundFx. Más... | |
void | free_resources () |
Libera recursos alocados por el manager. Más... | |
void | init (SDLTextureLoader &loader) |
Realiza la carga a memoria de todos los assets. Solo debe ser llamado una vez. Más... | |
Métodos públicos estáticos | |
static ResourceManager & | get_instance () |
Devuelve la instancia del resource manager. Más... | |
Singleton para el manager de texturas.
void ResourceManager::free_resources | ( | ) |
Libera recursos alocados por el manager.
AnimationPack & ResourceManager::get_animation_pack | ( | const std::string & | type, |
int | id | ||
) |
Devuelve un pack de animacion.
type | Tipo del pack de animacion. |
id | Id del pack de animacion, dentro de su tipo. |
TTF_Font * ResourceManager::get_font | ( | int | id | ) |
Devuelve una fuente de SDL.
id | Id de la fuente. |
|
static |
Devuelve la instancia del resource manager.
SDLMusic & ResourceManager::get_music | ( | int | id | ) |
SDLSoundFx & ResourceManager::get_sound_fx | ( | int | id | ) |
SDLSprite & ResourceManager::get_sprite | ( | const std::string & | type, |
int | id | ||
) |
Devuelve un sprite.
type | Tipo del sprite a obtener. |
id | Id del sprite, dentro de su tipo. |
SDLTexture & ResourceManager::get_texture | ( | const std::string & | type, |
int | id | ||
) |
Obtiene una textura.
type | Tipo de la textura a obtener. |
id | Id de la textura, dentro del tipo. |
void ResourceManager::init | ( | SDLTextureLoader & | loader | ) |
Realiza la carga a memoria de todos los assets. Solo debe ser llamado una vez.
loader | Loader a partir del cual se cargaran las texturas. |