GL++
0.1
OpenGL API C++ Wrapper
|
Program that can be executed in the GPU pipeline. More...
#include <program.hpp>
Public Types | |
typedef std::vector < shared_shader_t > | shaders_container_type |
Type of shaders container. | |
Public Types inherited from glpp::named_object< GLint > | |
typedef GLint | name_type |
Type of the name. |
Public Member Functions | |
program () | |
Construct an empty program. | |
~program () | |
Destroy and release resources of program. | |
void | attach_shader (const shared_shader_t &psh) |
Attach a shader at program pipeline. | |
void | detach_shader (const shared_shader_t &psh) |
Detach a shader object. | |
shaders_container_type | get_attached_shaders () const |
Get all attached shaders. | |
bool | is_linked () const |
Check if this program is linked. | |
void | link () throw (link_error) |
Links a program object. | |
void | build () throw (compile_error, link_error) |
Compile shaders and link them. | |
void | validate () |
Validates a program object. | |
bool | is_valid () const |
Check if this program is valid. | |
const std::string | info_log () const |
Returns the information log for a program object. | |
void | use () const |
Use this program for all future rendering calls. | |
const shared_uniform_t & | get_uniform (const std::string &name) throw (uniform_not_found) |
Get an active uniform variable declared in any place (in-block or global) | |
const bool | uniform_exists (const std::string &name) |
Check if there is uniform variable declared in any place (in-block or global) | |
const shared_uniform_t & | get_uniform (uniform::name_type uniform_index) throw (uniform_not_found) |
Get an active uniform variable declared in any place (in-block or global) by uniform index. | |
const shared_global_uniform_t & | get_global_uniform (const std::string &name) throw (uniform_not_found) |
Get an active uniform variable declared in global scope. | |
const shared_uniform_block_t & | get_uniform_block (const std::string &bname) throw (uniform_not_found) |
Get an active uniform block by name. | |
const shared_uniform_block_t & | get_uniform_block (uniform_block::name_type id) throw (uniform_not_found) |
Get an active uniform block by name. | |
void | bind_fragcolor_to_location (GLuint location, const std::string &name) |
Bind a user-defined varying out variable to a fragment shader color number. | |
GLuint | total_attached_shaders () const |
Get total attached shaders. | |
GLuint | total_active_atomic_counter_buffers () const |
Get total active atomic counter buffers. | |
GLuint | total_active_attributes () const |
Get total active attributes. | |
GLuint | max_name_of_active_attributes () const |
Get the maximum name length of all active attributes (including null character) | |
GLuint | total_active_uniforms () const |
Get total number of active uniforms. | |
GLuint | max_name_of_active_uniforms () const |
Get the maximum name length of all active uniforms (including null character) | |
GLuint | total_active_uniform_blocks () const |
Get total number of active uniform blocks. | |
GLuint | max_name_of_active_uniform_blocks () const |
Get the maximum name length of all active uniform blocks(including null character) | |
GLuint | binary_length () const |
Get length of programs binary format. | |
buffer_mode_type | transform_feedback_buffer_mode () const |
Get program's feedback buffer mode. | |
GLuint | total_transform_feedback_varyings () const |
Get total transform feedback varyings. | |
GLuint | max_name_of_transform_feedback_varying () const |
Get the maximum name length of all transform feedback varyings (including null character) | |
GLuint | max_geometry_vertices_out () const |
Get the maximum geometry vertices that can be produced. | |
primitive_type | geometry_input_type () const |
Get the primitive type of geometry input. | |
primitive_type | geometry_output_type () const |
Get the primitive type of geometry output. | |
Public Member Functions inherited from glpp::named_object< GLint > | |
name_type | object_name () const |
Return the name of object (handle) | |
Public Member Functions inherited from glpp::noncopyable | |
noncopyable (noncopyable &) | |
noncopyable & | operator= (noncopyable &) |
Protected Types | |
enum | param_type |
typedef std::map < uniform::name_type, shared_uniform_t > | uniforms_container_type |
Type of uniforms container. | |
typedef std::map < uniform_block::name_type, shared_uniform_block_t > | uniform_blocks_container_type |
Type of uniform blocks container. | |
typedef std::map < uniform::name_type, shared_global_uniform_t > | global_uniforms_container_type |
Type of global uniforms container. |
Protected Member Functions | |
GLint | get_param (param_type type) const |
Get a program parameter. |
Protected Attributes | |
uniforms_container_type | m_uniforms |
Uniforms container. | |
global_uniforms_container_type | m_global_uniforms |
Global uniforms container. | |
uniform_blocks_container_type | m_uniform_blocks |
Uniform block container. | |
shaders_container_type | m_shaders |
Shaders container. | |
Protected Attributes inherited from glpp::named_object< GLint > | |
GLint | m_gl_name |
Stored object name. |
Program that can be executed in the GPU pipeline.
|
protected |
: move them to types?
glpp::program::program | ( | ) |
Construct an empty program.
http://www.opengl.org/sdk/docs/man4/xhtml/glCreateProgram.xml
glpp::program::~program | ( | ) |
Destroy and release resources of program.
http://www.opengl.org/sdk/docs/man4/xhtml/glDeleteProgram.xml
void glpp::program::attach_shader | ( | const shared_shader_t & | psh | ) |
Attach a shader at program pipeline.
Shared pointer is kept till the shader is detached. http://www.opengl.org/sdk/docs/man4/xhtml/glAttachShader.xml
GLuint glpp::program::binary_length | ( | ) | const |
Get length of programs binary format.
void glpp::program::bind_fragcolor_to_location | ( | GLuint | location, |
const std::string & | name | ||
) |
Bind a user-defined varying out variable to a fragment shader color number.
http://www.opengl.org/sdk/docs/man4/xhtml/glBindFragDataLocation.xml
void glpp::program::build | ( | ) | throw (compile_error, link_error) |
Compile shaders and link them.
This function will iterate through all shaders try to compile them, and then link them to final program. Functions that depend on exclusive use of glpp API attach_shader() detach_shader()
void glpp::program::detach_shader | ( | const shared_shader_t & | psh | ) |
Detach a shader object.
http://www.opengl.org/sdk/docs/man4/xhtml/glDetachShader.xml
primitive_type glpp::program::geometry_input_type | ( | ) | const |
Get the primitive type of geometry input.
primitive_type glpp::program::geometry_output_type | ( | ) | const |
Get the primitive type of geometry output.
|
inline |
Get all attached shaders.
Functions that depend on exclusive use of glpp API attach_shader() detach_shader()
const shared_global_uniform_t & glpp::program::get_global_uniform | ( | const std::string & | name | ) | throw (uniform_not_found) |
Get an active uniform variable declared in global scope.
This will return a global_uniform object that can be used to query info and set the value of global variable.
uniform_not_found | If there is no uniform with this name, or if it is not a variable of global scope. |
const shared_uniform_t & glpp::program::get_uniform | ( | const std::string & | name | ) | throw (uniform_not_found) |
Get an active uniform variable declared in any place (in-block or global)
This will return a uniform object that can be used to query info about this variable.
const shared_uniform_t & glpp::program::get_uniform | ( | uniform::name_type | uniform_index | ) | throw (uniform_not_found) |
Get an active uniform variable declared in any place (in-block or global) by uniform index.
This will return a uniform object that can be used to query info about this variable.
const shared_uniform_block_t & glpp::program::get_uniform_block | ( | const std::string & | bname | ) | throw (uniform_not_found) |
Get an active uniform block by name.
This will return a uniform_block that can be used to query info and bind it to uniform buffer objects
const shared_uniform_block_t & glpp::program::get_uniform_block | ( | uniform_block::name_type | id | ) | throw (uniform_not_found) |
Get an active uniform block by name.
This will return a uniform block that can be used to query info and bind it to uniform buffer objects
const std::string glpp::program::info_log | ( | ) | const |
Returns the information log for a program object.
http://www.opengl.org/sdk/docs/man4/xhtml/glGetProgramInfoLog.xml
bool glpp::program::is_linked | ( | ) | const |
Check if this program is linked.
bool glpp::program::is_valid | ( | ) | const |
Check if this program is valid.
This function will return the result of validate() http://www.opengl.org/sdk/docs/man4/xhtml/glValidateProgram.xml
void glpp::program::link | ( | ) | throw (link_error) |
Links a program object.
GLuint glpp::program::max_geometry_vertices_out | ( | ) | const |
Get the maximum geometry vertices that can be produced.
GLuint glpp::program::max_name_of_active_attributes | ( | ) | const |
Get the maximum name length of all active attributes (including null character)
GLuint glpp::program::max_name_of_active_uniform_blocks | ( | ) | const |
Get the maximum name length of all active uniform blocks(including null character)
GLuint glpp::program::max_name_of_active_uniforms | ( | ) | const |
Get the maximum name length of all active uniforms (including null character)
GLuint glpp::program::max_name_of_transform_feedback_varying | ( | ) | const |
Get the maximum name length of all transform feedback varyings (including null character)
GLuint glpp::program::total_active_atomic_counter_buffers | ( | ) | const |
Get total active atomic counter buffers.
GLuint glpp::program::total_active_attributes | ( | ) | const |
Get total active attributes.
GLuint glpp::program::total_active_uniform_blocks | ( | ) | const |
Get total number of active uniform blocks.
GLuint glpp::program::total_active_uniforms | ( | ) | const |
Get total number of active uniforms.
GLuint glpp::program::total_attached_shaders | ( | ) | const |
Get total attached shaders.
GLuint glpp::program::total_transform_feedback_varyings | ( | ) | const |
Get total transform feedback varyings.
buffer_mode_type glpp::program::transform_feedback_buffer_mode | ( | ) | const |
Get program's feedback buffer mode.
const bool glpp::program::uniform_exists | ( | const std::string & | name | ) |
Check if there is uniform variable declared in any place (in-block or global)
This will return true or false depending in the existence of object.
|
inline |
Use this program for all future rendering calls.
void glpp::program::validate | ( | ) |
Validates a program object.
http://www.opengl.org/sdk/docs/man4/xhtml/glValidateProgram.xml