FlowVis 1.0

Shader Class Reference

List of all members.

Public Member Functions

 Shader (const string &path)
 Constructor. Loads shaders from files and compiles them.
 Shader (const string &path, bool geometryShader, GLenum inputType, GLenum outputType, GLint maxOutVertices)
 Constructor. Loads shaders from files and compiles them.
void bind () const
void unbind () const
GLint get_attrib_location (const std::string &name) const
GLint get_uniform_location (const std::string &name) const
 operator bool ()

Static Public Member Functions

static void get_errors (void)

Private Member Functions

bool init (const string &path, bool geometryShader, GLenum inputType, GLenum outputType, GLint maxOutVertices)
GLuint compile (GLenum type, const string &source)
void link (bool geometryShader, GLenum inputType, GLenum outputType, GLint maxOutVertices)
void shader_log (GLuint shader)
void program_log (GLuint program)
bool file_exists (const string &filename)
string read_file (const string &filename)

Private Attributes

bool _success
GLuint _vertex_shader
GLuint _geometry_shader
GLuint _fragment_shader
GLuint _program

Detailed Description

Definition at line 16 of file shader.h.


Constructor & Destructor Documentation

Shader::Shader ( const string &  path)

Constructor. Loads shaders from files and compiles them.

When path is "hello", the files "hello.frag" & "hello.vert" will be loaded. Calls the init function with geometryShader flag set to false.

Author:
Thomas
Date:
15.12.2010
Parameters:
pathFull pathname of the file.

Definition at line 5 of file shader.cpp.

Shader::Shader ( const string &  path,
bool  geometryShader,
GLenum  inputType,
GLenum  outputType,
GLint  maxOutVertices 
)

Constructor. Loads shaders from files and compiles them.

When path is "hello", the files "hello.frag" & "hello.vert" will be loaded. If the geometryShader flag is set to true, "hello.geom" will be loaded as well. If the flag is set to false, all arguments except for the path are ignored.

Author:
Thomas
Date:
15.12.2010
Parameters:
pathFull pathname of the file.
geometryShaderIndicates whether a geometry shader should be used.
inputTypeType of the OpenGL input primitive.
outputTypeType of the OpenGL output primitive.
maxOutVerticesThe maximum number of out vertices in the geometry shader per primitive. If this value is set to 0, the maximum possible number of vertices is queried and set as the number of output vertices.

Definition at line 13 of file shader.cpp.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends