DeferredRenderer 1.0
|
00001 #include "TextureManager.h" 00002 00003 TextureManager::TextureManager(){} 00004 TextureManager::~TextureManager(){} 00005 00006 void TextureManager::addTexture(Texture &_t) 00007 { 00008 m_textures.insert(std::pair<std::string, Texture>(_t.getName(), _t)); 00009 } 00010 00011 Texture TextureManager::getTexture(const std::string &_name) 00012 { 00013 return m_textures[_name]; 00014 } 00015 00016 GLuint TextureManager::getTextureId(const std::string &_name) 00017 { 00018 return m_textures[_name].id; 00019 } 00020 00021 void TextureManager::bindTexture(const std::string &_name) 00022 { 00023 m_textures[_name].bind(); 00024 } 00025 00026 void TextureManager::addEmptyf(const std::string &_name, int _w, int _h) 00027 { 00028 Texture tmp(_name); 00029 tmp.generateEmptyf(_w, _h); 00030 this->addTexture(tmp); 00031 } 00032 00033 void TextureManager::addEmpty(const std::string &_name, int _w, int _h) 00034 { 00035 Texture tmp(_name); 00036 tmp.generateEmpty(_w, _h); 00037 this->addTexture(tmp); 00038 } 00039