TextureManager Class Reference

#include <TextureManager.h>

Inheritance diagram for TextureManager:

EventListener Object

List of all members.

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 textureEntrygetEntry (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 TextureManagergetInstance ()
 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 TextureManagerinstance = 0
 The singleton instance.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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]

A method to deal with SDL_Event.

Implements EventListener.

struct textureEntry * TextureManager::getEntry ( const string &  filename  )  [read]

string TextureManager::toString (  )  const [virtual]

Returns a textual representation.

Returns:
a string descriping the run-time object

Implements EventListener.

string TextureManager::className (  )  const [virtual]

Returns the class name of the object.

Returns:
a string with the name of the object's class

Implements EventListener.

enum classId TextureManager::classId (  )  const [virtual]

Returns the class id of the object.

Returns:
an id of the object's class

Implements EventListener.


Member Data Documentation

TextureManager * TextureManager::instance = 0 [static, private]

The singleton instance.

The place to store all information about loaded textures.


The documentation for this class was generated from the following files:

Generated on Mon Jul 7 13:30:35 2008 for Firefly by  doxygen 1.5.6