This class converts text files into compiled shader programs.
More...
|
void | loadShader (const std::string &_path_to_shader, GLenum _shaderType, GLuint &_shaderHandle) |
| Creates a shader object out of a text file. More...
|
|
void | link () |
| Links the vertex and fragment shaders to one program. More...
|
|
This class converts text files into compiled shader programs.
Definition at line 10 of file Shader.h.
Shader::Shader |
( |
const std::string & |
_vertexShader, |
|
|
const std::string & |
_fragmentShader |
|
) |
| |
Constructor.
Loads the shader onto the GK by creating a program out of
the vertex and fragment shaders:
- Parameters
-
[in] | _vertexShader | |
[in] | _fragmentShader | |
Definition at line 7 of file Shader.cpp.
Destructor.
Deletes both shader handles and the program handle.
Definition at line 29 of file Shader.cpp.
Links the vertex and fragment shaders to one program.
It is called in the constructor.
Definition at line 103 of file Shader.cpp.
void Shader::loadShader |
( |
const std::string & |
_path_to_shader, |
|
|
GLenum |
_shaderType, |
|
|
GLuint & |
_shaderHandle |
|
) |
| |
|
private |
Creates a shader object out of a text file.
- Parameters
-
[in] | _path_to_shader | contains the path to the source code file of the shader. |
[in] | _shaderType | marks the shader as vertex or fragment shader. |
[out] | _shaderHandle | is a handle to the compiled shader on the GK.
It is called twice for the vertex and the fragment shaders in the constructor. |
Definition at line 48 of file Shader.cpp.
void Shader::releaseShader |
( |
| ) |
|
Instructs OpenGL to use the default pipeline for rendering.
Definition at line 42 of file Shader.cpp.
bool vis2::Shader::shaderInUse |
( |
| ) |
const |
|
inline |
Returns true if the shader has been bound, false otherwise.
Definition at line 32 of file Shader.h.
void Shader::useShader |
( |
| ) |
|
Instructs OpenGL to use this shader for rendering.
Definition at line 36 of file Shader.cpp.
GLuint vis2::Shader::fragment_shader_handle |
|
private |
handle to the fragment shader object
Definition at line 57 of file Shader.h.
GLuint vis2::Shader::program_handle |
handle to the linked shader program
Definition at line 34 of file Shader.h.
bool vis2::Shader::shader_in_use |
|
private |
is true when the shader program is bound, false otherwise
Definition at line 59 of file Shader.h.
GLuint vis2::Shader::vertex_shader_handle |
|
private |
handle to the vertex shader object
Definition at line 56 of file Shader.h.
The documentation for this class was generated from the following files: