FlowVis 1.0
|
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 |
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.
path | Full 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.
path | Full pathname of the file. |
geometryShader | Indicates whether a geometry shader should be used. |
inputType | Type of the OpenGL input primitive. |
outputType | Type of the OpenGL output primitive. |
maxOutVertices | The 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.