|
| shader_program (bool _show_code_errors=false) |
| create empty shader program More...
|
|
| ~shader_program () |
| call destruct method
|
|
bool | create (const context &ctx) |
| create the shader program
|
|
void | destruct (const context &ctx) |
| destruct shader program
|
|
bool | attach_code (const context &ctx, const shader_code &code) |
| attach a compiled shader code instance that is managed outside of program
|
|
bool | detach_code (const context &ctx, const shader_code &code) |
| detach a shader code
|
|
bool | attach_code (const context &ctx, const std::string &source, ShaderType st) |
| attach a shader code given as string and managed the created shader code object
|
|
bool | attach_file (const context &ctx, const std::string &file_name, ShaderType st=ST_DETECT, std::string defines="") |
| read shader code from file, compile and attach to program
|
|
bool | attach_files (const context &ctx, const std::string &base_name, std::string defines="") |
| read shader code from files with the given base name, compile and attach them
|
|
bool | attach_dir (const context &ctx, const std::string &dir_name, bool recursive) |
| collect shader code files from directory, compile and attach.
|
|
bool | attach_program (const context &ctx, const std::string &file_name, bool show_error=false, std::string defines="") |
| collect shader code files declared in shader program file, compile and attach them
|
|
bool | link (const context &ctx, bool show_error=false) |
| link shaders to an executable program
|
|
bool | is_linked () const |
| return whether program is linked
|
|
bool | build_files (const context &ctx, const std::string &base_name, bool show_error=false) |
| successively calls create, attach_files and link.
|
|
bool | build_dir (const context &ctx, const std::string &dir_name, bool recursive=false, bool show_error=false) |
| successively calls create, attach_dir and link.
|
|
bool | build_program (const context &ctx, const std::string &file_name, bool show_error=false, std::string defines="") |
| successively calls create, attach_program and link.
|
|
void | set_geometry_shader_info (PrimitiveType input_type, PrimitiveType output_type, int max_output_count=0) |
| configure the geometry shader, if count < 1 set it to get_max_nr_geometry_shader_output_vertices More...
|
|
bool | enable (context &ctx) |
| enable the shader program
|
|
bool | disable (context &ctx) |
| disable shader program and restore fixed functionality
|
|
bool | is_enabled () const |
| check whether program is currently enabled
|
|
int | get_uniform_location (const context &ctx, const std::string &name) const |
| query location index of an uniform
|
|
bool | set_material_uniform (const context &ctx, const std::string &name, const cgv::media::illum::surface_material &material, bool generate_error=false) |
| set a uniform of type material
|
|
bool | set_textured_material_uniform (const context &ctx, const std::string &name, const textured_material &material, bool generate_error=false) |
| set a uniform of type textured_material
|
|
bool | set_light_uniform (const context &ctx, const std::string &name, const cgv::media::illum::light_source &light, bool generate_error=false) |
| set a uniform of type light source
|
|
template<typename T > |
bool | set_uniform (const context &ctx, const std::string &name, const T &value, bool generate_error=false) |
|
template<typename T > |
bool | set_uniform_array (const context &ctx, const std::string &name, const T &array) |
| set uniform array from array array where number elements can be derived from array through array_descriptor_traits ; supported array types include cgv::math::vec and std::vector
|
|
template<typename T > |
bool | set_uniform_array (const context &ctx, const std::string &name, const T *array, size_t nr_elements, bool generate_error=false) |
| set uniform array from an array with nr_elements elements of type T pointed to by array
|
|
template<typename T > |
bool | set_uniform (const context &ctx, int loc, const T &value) |
|
template<typename T > |
bool | set_uniform_array (const context &ctx, int loc, const T &array) |
| set uniform array from array array where number elements can be derived from array through array_descriptor_traits ; supported array types include cgv::math::vec and std::vector
|
|
template<typename T > |
bool | set_uniform_array (const context &ctx, int loc, const T *array, size_t nr_elements) |
| set uniform array from an array with nr_elements elements of type T pointed to by array
|
|
int | get_attribute_location (const context &ctx, const std::string &name) const |
| query location index of an attribute
|
|
template<typename T > |
bool | set_attribute (const context &ctx, const std::string &name, const T &value) |
| set constant default value of a vertex attribute by attribute name, if name does not specify an attribute, an error message is generated
|
|
template<typename T > |
bool | set_attribute (const context &ctx, int loc, const T &value) |
| set constant default value of a vertex attribute by location index
|
|
virtual bool | is_created () const |
| return whether component has been created
|
|
void | put_id_void (void *ptr) const |
|
template<typename T > |
void | put_id (T &id) const |
| cast the refence to rendering api specific representation of component id to the specified type
|
|
a shader program combines several shader code fragments to a complete definition of the shading pipeline.