shader_program Class Reference

#include <shader.hpp>

Collaboration diagram for shader_program:

Collaboration graph
[legend]

List of all members.


Detailed Description

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

Constructor & Destructor Documentation

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().


Member Function Documentation

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]

Definition at line 78 of file shader.hpp.

Referenced by stellar_db::init().

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 
)

Definition at line 352 of file shader.cpp.

References shader_program::get_uniform_loc().

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().


Member Data Documentation

int opengl_id [private]


The documentation for this class was generated from the following files:

Generated on Sat Mar 1 13:50:07 2008 for Periapsis Project by  doxygen 1.5.5