DeferredRenderer 1.0
|
Container and manager for all the application textures. More...
#include <TextureManager.h>
Public Member Functions | |
TextureManager () | |
ctor | |
~TextureManager () | |
dtor | |
void | addTexture (Texture &_t) |
add a texture object | |
Texture | getTexture (const std::string &_name) |
access texture by name | |
GLuint | getTextureId (const std::string &_name) |
get texture ID by | |
void | bindTexture (const std::string &_name) |
bind texture by name | |
void | addEmptyf (const std::string &_name, int _w, int _h) |
add empty float texture | |
void | addEmpty (const std::string &_name, int _w, int _h) |
add empty rgba texture | |
Private Attributes | |
std::map< std::string, Texture > | m_textures |
texture container |
Container and manager for all the application textures.
Definition at line 16 of file TextureManager.h.
TextureManager::TextureManager | ( | ) |
TextureManager::~TextureManager | ( | ) |
void TextureManager::addEmpty | ( | const std::string & | _name, |
int | _w, | ||
int | _h | ||
) |
add empty rgba texture
Definition at line 33 of file TextureManager.cpp.
References addTexture(), and Texture::generateEmpty().
{ Texture tmp(_name); tmp.generateEmpty(_w, _h); this->addTexture(tmp); }
void TextureManager::addEmptyf | ( | const std::string & | _name, |
int | _w, | ||
int | _h | ||
) |
add empty float texture
Definition at line 26 of file TextureManager.cpp.
References addTexture(), and Texture::generateEmptyf().
{ Texture tmp(_name); tmp.generateEmptyf(_w, _h); this->addTexture(tmp); }
void TextureManager::addTexture | ( | Texture & | _t | ) |
add a texture object
Definition at line 6 of file TextureManager.cpp.
References Texture::getName(), and m_textures.
{ m_textures.insert(std::pair<std::string, Texture>(_t.getName(), _t)); }
void TextureManager::bindTexture | ( | const std::string & | _name | ) |
bind texture by name
Definition at line 21 of file TextureManager.cpp.
References m_textures.
{ m_textures[_name].bind(); }
Texture TextureManager::getTexture | ( | const std::string & | _name | ) |
access texture by name
Definition at line 11 of file TextureManager.cpp.
References m_textures.
{ return m_textures[_name]; }
GLuint TextureManager::getTextureId | ( | const std::string & | _name | ) |
get texture ID by
Definition at line 16 of file TextureManager.cpp.
References m_textures.
{ return m_textures[_name].id; }
std::map<std::string, Texture> TextureManager::m_textures [private] |
texture container
Definition at line 46 of file TextureManager.h.