SWE
Public Member Functions
Shader Class Reference

List of all members.

Public Member Functions

 Shader (char const *vertexShaderFile, char const *fragmentShaderFile)
 ~Shader ()
bool shadersLoaded ()
void enableShader ()
void disableShader ()
GLint getUniformLocation (const char *name)
void setUniform (GLint location, GLfloat value)

Constructor & Destructor Documentation

Shader::Shader ( char const *  vertexShaderFile,
char const *  fragmentShaderFile 
)

Constructor. Check whether shaders are supported. If yes, load vertex and fragment shader from textfile into memory and compile

Parameters:
vertexShaderFilename of the text file containing the vertex shader code
fragmentShaderFilename of the text file containing the fragment shader code

Destructor. Unload shaders and free resources.


Member Function Documentation

Restores OpenGL default shaders

Replaces OpenGL shaders by our custom shaders

GLint Shader::getUniformLocation ( const char *  name) [inline]
Returns:
Location of the uniform variable
void Shader::setUniform ( GLint  location,
GLfloat  value 
) [inline]

Set a uniform variable in the shader

Returns, whether shaders could by loaded successfully


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends