Shader Class Reference

#include <Shader.h>

List of all members.

Public Member Functions

 Shader ()
 ~Shader ()
void load ()
void activate ()
void deactivate ()
void uploadTexture (const char *name, GLint textureUnit)
void uploadUniformInt (const char *name, int value)
void uploadUniformFloat (const char *name, float value)
void uploadUniformVec2 (const char *name, float *values)
 Shader ()
 ~Shader ()
void load ()
void activate ()
void deactivate ()
void uploadTexture (const char *name, GLint textureUnit)
void uploadUniformInt (const char *name, int value)
void uploadUniformFloat (const char *name, float value)
void uploadUniformVec2 (const char *name, float *values)

Private Member Functions

void getShadersLog (GLuint shader)
void getShadersLog (GLuint shader)

Private Attributes

GLuint programShader
GLuint fragmentShader
GLuint vertexShader


Detailed Description

Class for loading and managing shaders

Constructor & Destructor Documentation

Shader::Shader (  ) 

Constructs a new shader object.

Shader::~Shader (  ) 

Destroys the shader object.

Shader::Shader (  ) 

Shader::~Shader (  ) 


Member Function Documentation

void Shader::activate (  ) 

void Shader::activate (  ) 

Activates the shaders

void Shader::deactivate (  ) 

void Shader::deactivate (  ) 

Deactivates the shaders

void Shader::getShadersLog ( GLuint  shader  )  [private]

void Shader::getShadersLog ( GLuint  shader  )  [private]

Prints the current shaderlog of shader shader on the console

Parameters:
shader The shader which shader log should be printed to the console

void Shader::load (  ) 

void Shader::load (  ) 

Loads the shaders

void Shader::uploadTexture ( const char *  name,
GLint  textureUnit 
)

void Shader::uploadTexture ( const char *  name,
GLint  textureUnit 
)

Uploads a texture as a uniform

Parameters:
name Name of the texture in the shader
textureUnit Texture unit at which the texture should be bounded

void Shader::uploadUniformFloat ( const char *  name,
float  value 
)

void Shader::uploadUniformFloat ( const char *  name,
float  value 
)

Uploads a float as a uniform

Parameters:
name Name of the float in the shader
value Float-Value of the variable which should be uploaded to the GPU

void Shader::uploadUniformInt ( const char *  name,
int  value 
)

void Shader::uploadUniformInt ( const char *  name,
int  value 
)

Uploads an integer as a uniform

Parameters:
name Name of the integer in the shader
value Integer-Value of the variable which should be uploaded to the GPU

void Shader::uploadUniformVec2 ( const char *  name,
float *  values 
)

void Shader::uploadUniformVec2 ( const char *  name,
float *  values 
)

Uploads a float vec2 as a uniform

Parameters:
name Name of the float in the shader
values Float-Values (Array with dimension 2) of the variable which should be uploaded to the GPU


Member Data Documentation

GLuint Shader::fragmentShader [private]

fragment shader int

GLuint Shader::programShader [private]

shader-int

GLuint Shader::vertexShader [private]

vertex shader int


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

Generated on Tue Jan 20 23:44:14 2009 for FlowVis by  doxygen 1.5.7.1