#include <TextureManager.h>

Public Member Functions | |
| void | registerTexture (const string &filename, const bool &repeat) |
| Registers a texture for use in the Texture Manager. | |
| void | unregisterTexture (const string &filename) |
| Unregisters a texture. | |
| void | unregisterTexture (struct textureEntry *const data) |
| Unregisters a texture. | |
| void | processEvent (SDL_Event &event) |
| A method to deal with SDL_Event. | |
| struct textureEntry * | getEntry (const string &filename) |
| virtual string | toString () const |
| Returns a textual representation. | |
| virtual string | className () const |
| Returns the class name of the object. | |
| virtual enum classId | classId () const |
| Returns the class id of the object. | |
Static Public Member Functions | |
| static TextureManager * | getInstance () |
| The singleton getter. | |
Private Member Functions | |
| TextureManager () | |
| The constructor. | |
| TextureManager (const TextureManager &source) | |
| The copy constructor. | |
| ~TextureManager () | |
| The destructor. | |
| void | loadTexture (struct textureEntry *entry) |
| Loads a image from file to OpenGL. | |
| void | reload () |
| Reloads textures after resize. | |
Private Attributes | |
| vector< textureEntry * > | textures |
| The place to store all information about loaded textures. | |
Static Private Attributes | |
| static TextureManager * | instance = 0 |
| The singleton instance. | |
| TextureManager::TextureManager | ( | ) | [private] |
The constructor.
Initializes the texture manager.
| TextureManager::TextureManager | ( | const TextureManager & | source | ) | [private] |
The copy constructor.
Should not be called.
| TextureManager::~TextureManager | ( | ) | [private] |
The destructor.
Destroyes the texture manager and frees all memory occupied by textures. Should only be called for program termination.
| void TextureManager::loadTexture | ( | struct textureEntry * | entry | ) | [private] |
Loads a image from file to OpenGL.
Creates a Texture from File
| void TextureManager::reload | ( | ) | [private] |
Reloads textures after resize.
Reloads all used textures from disk to graphics card memory
| TextureManager * TextureManager::getInstance | ( | ) | [static] |
The singleton getter.
The only way to access the manager
| void TextureManager::registerTexture | ( | const string & | filename, | |
| const bool & | repeat | |||
| ) |
Registers a texture for use in the Texture Manager.
Adds a texture if not already present, otherwise increases its count.
| filename | Must be a valid filename otherwise a default image will be loaded. |
| void TextureManager::unregisterTexture | ( | const string & | filename | ) |
Unregisters a texture.
Removes a texture from memory if no longer used by other objects, otherwise decreases its count.
| filename | Must be a filename already registered otherwise the call will have no effect. |
| void TextureManager::unregisterTexture | ( | struct textureEntry *const | data | ) |
Unregisters a texture.
| void TextureManager::processEvent | ( | SDL_Event & | event | ) | [virtual] |
| struct textureEntry * TextureManager::getEntry | ( | const string & | filename | ) | [read] |
| string TextureManager::toString | ( | ) | const [virtual] |
Returns a textual representation.
Implements EventListener.
| string TextureManager::className | ( | ) | const [virtual] |
Returns the class name of the object.
Implements EventListener.
| enum classId TextureManager::classId | ( | ) | const [virtual] |
TextureManager * TextureManager::instance = 0 [static, private] |
The singleton instance.
vector<textureEntry*> TextureManager::textures [private] |
The place to store all information about loaded textures.
1.5.6