#include <ShaderManager.h>

Public Member Functions | |
| void | registerShader (const string &filename) |
| Registers a shader for use in the Shader Manager. | |
| void | unregisterShader (const string &filename) |
| Unregisters a shader. | |
| void | unregisterShader (struct shaderEntry *const data) |
| Unregisters a shader. | |
| void | processEvent (SDL_Event &event) |
| A method to deal with SDL_Event. | |
| struct shaderEntry * | 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 ShaderManager * | getInstance () |
| The singleton getter. | |
Private Member Functions | |
| ShaderManager () | |
| The constructor. | |
| ShaderManager (const ShaderManager &source) | |
| The copy constructor. | |
| ~ShaderManager () | |
| The destructor. | |
| char * | loadSource (const char *filename) |
| reads a textfile | |
| void | loadShader (struct shaderEntry *entry) |
| Loads a shader from file to OpenGL. | |
| void | reload () |
| Reloads textures after resize. | |
Private Attributes | |
| vector< shaderEntry * > | shaders |
| The place to store all information about loaded textures. | |
Static Private Attributes | |
| static ShaderManager * | instance = 0 |
| The singleton instance. | |
| ShaderManager::ShaderManager | ( | ) | [private] |
The constructor.
Initializes the shader manager.
| ShaderManager::ShaderManager | ( | const ShaderManager & | source | ) | [private] |
The copy constructor.
Should not be called.
| ShaderManager::~ShaderManager | ( | ) | [private] |
The destructor.
Destroyes the shader manager and frees all memory occupied by shaders. Should only be called for program termination.
| char * ShaderManager::loadSource | ( | const char * | filename | ) | [private] |
reads a textfile
Reads a textfile from disk
| filename | The file to be read. |
| void ShaderManager::loadShader | ( | struct shaderEntry * | entry | ) | [private] |
Loads a shader from file to OpenGL.
Creates a shader from file
| void ShaderManager::reload | ( | ) | [private] |
Reloads textures after resize.
Reloads all used shader from disk to graphics card memory
| ShaderManager * ShaderManager::getInstance | ( | ) | [static] |
The singleton getter.
The only way to access the manager
| void ShaderManager::registerShader | ( | const string & | filename | ) |
Registers a shader for use in the Shader Manager.
Adds a shader if not already present, otherwise increases its count.
| filename | Must be a valid filename (without suffix) otherwise we got a problem |
| void ShaderManager::unregisterShader | ( | const string & | filename | ) |
Unregisters a shader.
Removes a shader from memory if no longer used by other objects, otherwise decreases its count.
| filename | Must be a filename (without suffix) already registered otherwise the call will have no effect. |
| void ShaderManager::unregisterShader | ( | struct shaderEntry *const | data | ) |
Unregisters a shader.
| void ShaderManager::processEvent | ( | SDL_Event & | event | ) | [virtual] |
| struct shaderEntry * ShaderManager::getEntry | ( | const string & | filename | ) | [read] |
| string ShaderManager::toString | ( | ) | const [virtual] |
Returns a textual representation.
Implements EventListener.
| string ShaderManager::className | ( | ) | const [virtual] |
Returns the class name of the object.
Implements EventListener.
| enum classId ShaderManager::classId | ( | ) | const [virtual] |
ShaderManager * ShaderManager::instance = 0 [static, private] |
The singleton instance.
vector<shaderEntry*> ShaderManager::shaders [private] |
The place to store all information about loaded textures.
1.5.6