#include <ShaderManager.h>
Public Member Functions | |
ShaderManager () | |
~ShaderManager () | |
Destruktor. | |
GLuint | createVertShader () |
creates a Vertex-Shader-Object | |
GLuint | createFragShader () |
creates a Fragment-Shader-Object | |
std::string | getShaderSourceFromFile (std::string fileName) |
loads a Shader from a file and returns it as an String | |
void | setShaderSource (GLuint shader, const char *shaderSource, GLint *shaderLength) |
sets the Shader-Source | |
void | compileShader (GLuint shader) |
compiles the Shader | |
GLuint | createProgram () |
creates a Program-Object | |
void | attachShaders (GLuint programObject, GLuint vertShaderObject, GLuint fragShaderObject) |
attached the Vertex and Fragment Shader to a Shader-Object | |
void | linkProgram (GLuint programObject) |
links the Program | |
void | shutDown () |
shuts the Shader-Manager down (newer used) | |
void | addShader (std::string vertFileName, std::string fragFileName) |
adds a Shader to the Manager | |
GLuint | getShader (std::string shaderName) |
gets back the Shader-Object | |
Private Member Functions | |
GLuint | getShaderObject (std::string shaderName) |
returns the Shader-Object-Id of a Shader identified by it's Name | |
Private Attributes | |
std::vector< Shader > | myShaders |
saves all Shader used |
ths Class handles the loading, compilation and use of the different Shaders
ShaderManager::ShaderManager | ( | ) |
ShaderManager::~ShaderManager | ( | ) |
Destruktor.
void ShaderManager::addShader | ( | std::string | vertFileName, | |
std::string | fragFileName | |||
) |
adds a Shader to the Manager
void ShaderManager::attachShaders | ( | GLuint | programObject, | |
GLuint | vertShaderObject, | |||
GLuint | fragShaderObject | |||
) |
attached the Vertex and Fragment Shader to a Shader-Object
void ShaderManager::compileShader | ( | GLuint | shader | ) |
compiles the Shader
GLuint ShaderManager::createFragShader | ( | ) |
creates a Fragment-Shader-Object
GLuint ShaderManager::createProgram | ( | ) |
creates a Program-Object
GLuint ShaderManager::createVertShader | ( | ) |
creates a Vertex-Shader-Object
GLuint ShaderManager::getShader | ( | std::string | shaderName | ) |
gets back the Shader-Object
GLuint ShaderManager::getShaderObject | ( | std::string | shaderName | ) | [private] |
returns the Shader-Object-Id of a Shader identified by it's Name
std::string ShaderManager::getShaderSourceFromFile | ( | std::string | fileName | ) |
loads a Shader from a file and returns it as an String
void ShaderManager::linkProgram | ( | GLuint | programObject | ) |
links the Program
void ShaderManager::setShaderSource | ( | GLuint | shader, | |
const char * | shaderSource, | |||
GLint * | shaderLength | |||
) |
sets the Shader-Source
void ShaderManager::shutDown | ( | ) |
shuts the Shader-Manager down (newer used)
std::vector<Shader> ShaderManager::myShaders [private] |
saves all Shader used