MVE - Multi-View Environment mve-devel
|
Abstraction for OpenGL Shader Programs. More...
#include <shader_program.h>
Public Types | |
typedef std::shared_ptr< ShaderProgram const > | ConstPtr |
typedef std::shared_ptr< ShaderProgram > | Ptr |
Public Member Functions | |
~ShaderProgram (void) | |
void | bind (void) |
Selects the shader program for rendering. | |
GLint | get_attrib_location (char const *name) |
Returns attribute location for the program. | |
GLint | get_uniform_location (char const *name) |
Returns the uniform location of the program. | |
void | load_frag_code (std::string const &code) |
Load fragment shader from code in memory. | |
void | load_frag_file (std::string const &filename) |
Load fragment shader from file. | |
void | load_geom_code (std::string const &code) |
Loads optional geometry shader from code in memory. | |
void | load_geom_file (std::string const &filename) |
Loads optional geometry shader from file. | |
void | load_vert_code (std::string const &code) |
Loads a vertex shader from code in memory. | |
void | load_vert_file (std::string const &filename) |
Loads a vertex shader from file. | |
void | send_uniform (char const *name, GLfloat val) |
Sends float 'val' to uniform location 'name'. | |
void | send_uniform (char const *name, GLint val) |
Sends integer 'val' to uniform location 'name'. | |
void | send_uniform (char const *name, math::Matrix4f const &m) |
Sends 4x4-matrx 'm' to uniform location 'name'. | |
void | send_uniform (char const *name, math::Vec3f const &v) |
Sends 3-vector 'v' to uniform location 'name'. | |
void | send_uniform (char const *name, math::Vec4f const &v) |
Sends 4-vector 'v' to uniform location 'name'. | |
bool | try_load_all (std::string const &basename) |
Try loading all shaders by appending ".vert", ".geom" and ".frag" to basename. | |
void | unbind (void) const |
Deselects the currend shader program. | |
void | unload_frag (void) |
Unloads fragment shader. | |
void | unload_geom (void) |
Unloads geometry shader. | |
void | unload_vert (void) |
Unloads vertex shader. | |
Static Public Member Functions | |
static Ptr | create (void) |
Abstraction for OpenGL Shader Programs.
Definition at line 32 of file shader_program.h.
typedef std::shared_ptr<ShaderProgram const> ogl::ShaderProgram::ConstPtr |
Definition at line 36 of file shader_program.h.
typedef std::shared_ptr<ShaderProgram> ogl::ShaderProgram::Ptr |
Definition at line 35 of file shader_program.h.
|
inline |
Definition at line 138 of file shader_program.h.
|
inline |
Selects the shader program for rendering.
Definition at line 289 of file shader_program.h.
|
inlinestatic |
Definition at line 151 of file shader_program.h.
|
inline |
Returns attribute location for the program.
If the program has not yet been linked, it is linked first. If there is no attribute by that name, -1 is returned.
Definition at line 229 of file shader_program.h.
|
inline |
Returns the uniform location of the program.
If the program has not yet been linked, it is linked first. If there is no uniform variable by that name, -1 is returned.
Definition at line 236 of file shader_program.h.
|
inline |
Load fragment shader from code in memory.
Definition at line 187 of file shader_program.h.
|
inline |
Load fragment shader from file.
Definition at line 169 of file shader_program.h.
|
inline |
Loads optional geometry shader from code in memory.
Definition at line 181 of file shader_program.h.
|
inline |
Loads optional geometry shader from file.
Definition at line 163 of file shader_program.h.
|
inline |
Loads a vertex shader from code in memory.
Definition at line 175 of file shader_program.h.
|
inline |
Loads a vertex shader from file.
Definition at line 157 of file shader_program.h.
|
inline |
Sends float 'val' to uniform location 'name'.
Definition at line 280 of file shader_program.h.
|
inline |
Sends integer 'val' to uniform location 'name'.
Definition at line 271 of file shader_program.h.
|
inline |
Sends 4x4-matrx 'm' to uniform location 'name'.
Definition at line 262 of file shader_program.h.
|
inline |
Sends 3-vector 'v' to uniform location 'name'.
Definition at line 244 of file shader_program.h.
|
inline |
Sends 4-vector 'v' to uniform location 'name'.
Definition at line 253 of file shader_program.h.
bool ogl::ShaderProgram::try_load_all | ( | std::string const & | basename | ) |
Try loading all shaders by appending ".vert", ".geom" and ".frag" to basename.
Definition at line 124 of file shader_program.cc.
|
inline |
Deselects the currend shader program.
Definition at line 297 of file shader_program.h.
|
inline |
Unloads fragment shader.
Definition at line 217 of file shader_program.h.
|
inline |
Unloads geometry shader.
Definition at line 205 of file shader_program.h.
|
inline |
Unloads vertex shader.
Definition at line 193 of file shader_program.h.