#include <Texture.h>
Friends | |
TextureManager & | GetTextureManager () |
Mutators | |
boost::shared_ptr< Texture > | StoreTexture (Texture *texture, const std::string &texture_name) |
boost::shared_ptr< Texture > | StoreTexture (const boost::shared_ptr< Texture > &texture, const std::string &texture_name) |
boost::shared_ptr< Texture > | GetTexture (const std::string &name, bool mipmap=false) |
void | FreeTexture (const std::string &name) |
This class is essentially a very thin wrapper around a map of Texture smart pointers, keyed on std::string texture names. The user need only request a texture through GetTexture(); if the texture is not already resident, it will be loaded. If the user would like to create her own images and store them in the manager, that can be accomplished via StoreTexture() calls.
Definition at line 236 of file Texture.h.
boost::shared_ptr<Texture> GG::TextureManager::StoreTexture | ( | Texture * | texture, | |
const std::string & | texture_name | |||
) |
Stores a pre-existing GG::Texture in the manager's texture pool, and returns a shared_ptr to it.
boost::shared_ptr<Texture> GG::TextureManager::StoreTexture | ( | const boost::shared_ptr< Texture > & | texture, | |
const std::string & | texture_name | |||
) |
Stores a pre-existing GG::Texture in the manager's texture pool, and returns a shared_ptr to it.
boost::shared_ptr<Texture> GG::TextureManager::GetTexture | ( | const std::string & | name, | |
bool | mipmap = false | |||
) |
Returns a shared_ptr to the texture created from image file name. If the texture is not present in the manager's pool, it will be loaded from disk.
void GG::TextureManager::FreeTexture | ( | const std::string & | name | ) |
Removes the manager's shared_ptr to the texture created from image file name, if it exists.
TextureManager& GetTextureManager | ( | ) | [friend] |
Returns the singleton TextureManager instance.