#include <VboManager.h>

Public Member Functions | |
| void | registerObject (const string &filename) |
| Registers a texture for use in the Texture Manager. | |
| void | unregisterObject (const string &filename) |
| Unregisters a texture. | |
| void | processEvent (SDL_Event &event) |
| A method to deal with SDL_Event. | |
| struct vboEntry * | 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 VboManager * | getInstance () |
| The singleton getter. | |
Private Member Functions | |
| void | createStandardMesh (struct vboEntry *entry) |
| Creates a standard mesh if no file is available. | |
| void | loadBmm (struct vboEntry *entry) |
| Loads raw data from a bmm file. | |
| void | calculateNormals (struct vboEntry *entry) |
| Calculates the normals for each vertex in an entry. | |
| void | createVbo (struct vboEntry *entry) |
| Creates VBOs from raw data. | |
| void | loadObject (struct vboEntry *entry) |
| Loads a triangle mesh from file to OpenGL. | |
| void | reload () |
| Restores VBO's on resizes. | |
| VboManager () | |
| The constructor. | |
| VboManager (const VboManager &source) | |
| The copy constructor. | |
| ~VboManager () | |
| The destructor. | |
Private Attributes | |
| vector< vboEntry * > | objects |
| The place to store all information about loaded textures. | |
Static Private Attributes | |
| static VboManager * | instance = 0 |
| The singleton instance. | |
| VboManager::VboManager | ( | ) | [private] |
The constructor.
Initializes the texture manager.
| VboManager::VboManager | ( | const VboManager & | source | ) | [private] |
The copy constructor.
Should not be called.
| VboManager::~VboManager | ( | ) | [private] |
The destructor.
Destroyes the texture manager and frees all memory occupied by textures. Should only be called for program termination.
| void VboManager::createStandardMesh | ( | struct vboEntry * | entry | ) | [private] |
Creates a standard mesh if no file is available.
Creates the raw data for a square plane in the x/z-plane sized 100.0 world units centered at the origin.
| entry | The entry in which to load the raw data |
| void VboManager::loadBmm | ( | struct vboEntry * | entry | ) | [private] |
Loads raw data from a bmm file.
| void VboManager::calculateNormals | ( | struct vboEntry * | entry | ) | [private] |
Calculates the normals for each vertex in an entry.
Calculates the normals for each vertex based on the normals of each adjacent triangle.
| void VboManager::createVbo | ( | struct vboEntry * | entry | ) | [private] |
Creates VBOs from raw data.
| void VboManager::loadObject | ( | struct vboEntry * | entry | ) | [private] |
Loads a triangle mesh from file to OpenGL.
Loads bmm-Meshes. These meshes have a local coordinate system that is oriented as follows: x-Axis is the facing direction of the mesh, y-Axis is the top-direction of the mesh and z-Axis is right from the viewpoint of the mesh. Note that the normals saved witin the file will be replaced by freshly calculated ones.
| meshFilename | The mesh to be loaded (must be a proper bmm, otherwise fatal runtime errors will occur). |
| void VboManager::reload | ( | ) | [private] |
Restores VBO's on resizes.
| VboManager * VboManager::getInstance | ( | ) | [static] |
The singleton getter.
The only way to access the manager
| void VboManager::registerObject | ( | const string & | filename | ) |
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 VboManager::unregisterObject | ( | 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 VboManager::processEvent | ( | SDL_Event & | event | ) | [virtual] |
| struct vboEntry * VboManager::getEntry | ( | const string & | filename | ) | [read] |
| string VboManager::toString | ( | ) | const [virtual] |
Returns a textual representation.
Implements EventListener.
| string VboManager::className | ( | ) | const [virtual] |
Returns the class name of the object.
Implements EventListener.
| enum classId VboManager::classId | ( | ) | const [virtual] |
VboManager * VboManager::instance = 0 [static, private] |
The singleton instance.
vector<vboEntry*> VboManager::objects [private] |
The place to store all information about loaded textures.
1.5.6