#include <shader.hpp>

Definition at line 49 of file shader.hpp.
Public Member Functions | |
| void | add_fragment_shader (const gsgl::string &fname) |
| void | add_vertex_shader (const gsgl::string &fname) |
| void | bind () |
| Tells OpenGL to use the shader program. | |
| int | get_id () |
| void | load () |
| Loads and compiles the shader program. This should only be called in the main thread with a valid OpenGL context. | |
| void | set_uniform (const char *name, const bool b) |
| void | set_uniform (const char *name, const float ff[4]) |
| void | set_uniform (const char *name, const float &f) |
| void | set_uniform (const char *name, const int &i) |
| shader_program () | |
| void | unbind () |
| Tells OpenGL to used the default shaders. | |
| void | unload () |
| Unloads the shader program. | |
| ~shader_program () | |
Private Member Functions | |
| int | get_uniform_loc (const char *name) |
Private Attributes | |
| int | opengl_id |
| gsgl::data::list< shader_base * > | shaders |
| shader_program | ( | ) |
Definition at line 225 of file shader.cpp.
| ~shader_program | ( | ) |
Definition at line 231 of file shader.cpp.
References shader_program::shaders, and shader_program::unload().
| void add_fragment_shader | ( | const gsgl::string & | fname | ) |
Definition at line 246 of file shader.cpp.
References file::get_full_path(), and shader_program::shaders.
| void add_vertex_shader | ( | const gsgl::string & | fname | ) |
Definition at line 240 of file shader.cpp.
References file::get_full_path(), and shader_program::shaders.
Referenced by stellar_db::stellar_db().
| void bind | ( | ) |
Tells OpenGL to use the shader program.
Definition at line 312 of file shader.cpp.
References CHECK_GL_ERRORS, and shader_program::opengl_id.
Referenced by stellar_db::draw(), and stellar_db::init().
| int get_id | ( | ) | [inline] |
| int get_uniform_loc | ( | const char * | name | ) | [private] |
Definition at line 358 of file shader.cpp.
References assert, CHECK_GL_ERRORS, and shader_program::opengl_id.
Referenced by shader_program::set_uniform().
| void load | ( | ) |
Loads and compiles the shader program. This should only be called in the main thread with a valid OpenGL context.
Definition at line 252 of file shader.cpp.
References CHECK_GL_ERRORS, shader_program::opengl_id, and shader_program::shaders.
Referenced by stellar_db::init().
| void set_uniform | ( | const char * | name, | |
| const bool | b | |||
| ) |
| void set_uniform | ( | const char * | name, | |
| const float | ff[4] | |||
| ) |
Definition at line 346 of file shader.cpp.
References CHECK_GL_ERRORS, and shader_program::get_uniform_loc().
| void set_uniform | ( | const char * | name, | |
| const float & | f | |||
| ) |
Definition at line 340 of file shader.cpp.
References CHECK_GL_ERRORS, and shader_program::get_uniform_loc().
| void set_uniform | ( | const char * | name, | |
| const int & | i | |||
| ) |
Definition at line 334 of file shader.cpp.
References CHECK_GL_ERRORS, and shader_program::get_uniform_loc().
Referenced by lithosphere_qt_node::draw().
| void unbind | ( | ) |
Tells OpenGL to used the default shaders.
Definition at line 326 of file shader.cpp.
References CHECK_GL_ERRORS.
Referenced by stellar_db::draw(), and stellar_db::init().
| void unload | ( | ) |
Unloads the shader program.
Definition at line 299 of file shader.cpp.
References CHECK_GL_ERRORS, shader_program::opengl_id, and shader_program::shaders.
Referenced by stellar_db::cleanup(), and shader_program::~shader_program().
int opengl_id [private] |
Definition at line 51 of file shader.hpp.
Referenced by shader_program::bind(), shader_program::get_uniform_loc(), shader_program::load(), and shader_program::unload().
gsgl::data::list<shader_base *> shaders [private] |
Definition at line 53 of file shader.hpp.
Referenced by shader_program::add_fragment_shader(), shader_program::add_vertex_shader(), shader_program::load(), shader_program::unload(), and shader_program::~shader_program().
1.5.5