#include <program_object.h>
Construction | |
| CL_ProgramObject () | |
| Construct OpenGL program object. | |
| CL_ProgramObject (CL_GraphicContext &gc) | |
| Constructs a ProgramObject. | |
| CL_ProgramObject (CL_GraphicContextProvider *gc_provider) | |
| Constructs a ProgramObject. | |
| virtual | ~CL_ProgramObject () |
| static CL_ProgramObject | load (CL_GraphicContext &gc, const CL_StringRef &resource_id, CL_ResourceManager *resman) |
| Load. | |
| static CL_ProgramObject | load (CL_GraphicContext &gc, const CL_StringRef &vertex_fullname, const CL_StringRef &fragment_fullname) |
| Load. | |
| static CL_ProgramObject | load (CL_GraphicContext &gc, const CL_StringRef &vertex_filename, const CL_StringRef &fragment_filename, const CL_VirtualDirectory &directory) |
| Load. | |
| static CL_ProgramObject | load (CL_GraphicContext &gc, CL_IODevice &vertex_file, CL_IODevice &fragment_file) |
| Load. | |
| static CL_ProgramObject | load (CL_GraphicContext &gc, const CL_StringRef &fragment_fullname) |
| Load. | |
| static CL_ProgramObject | load (CL_GraphicContext &gc, const CL_StringRef &fragment_filename, const CL_VirtualDirectory &directory) |
| Load. | |
| static CL_ProgramObject | load (CL_GraphicContext &gc, CL_IODevice &fragment_file) |
| Load. | |
| static CL_ProgramObject | load_and_link (CL_GraphicContext &gc, const CL_StringRef &vertex_fullname, const CL_StringRef &fragment_fullname) |
| Load and link. | |
| static CL_ProgramObject | load_and_link (CL_GraphicContext &gc, const CL_StringRef &vertex_filename, const CL_StringRef &fragment_filename, const CL_VirtualDirectory &directory) |
| Load and link. | |
| static CL_ProgramObject | load_and_link (CL_GraphicContext &gc, CL_IODevice &vertex_file, CL_IODevice &fragment_file) |
| Load and link. | |
| static CL_ProgramObject | load_and_link (CL_GraphicContext &gc, const CL_StringRef &fragment_fullname) |
| Load and link. | |
| static CL_ProgramObject | load_and_link (CL_GraphicContext &gc, const CL_StringRef &fragment_filename, const CL_VirtualDirectory &directory) |
| Load and link. | |
| static CL_ProgramObject | load_and_link (CL_GraphicContext &gc, CL_IODevice &fragment_file) |
| Load and link. | |
Public Member Functions | |
Attributes | |
| bool | is_null () const |
| Returns true if the Program object is a dummy. | |
| unsigned int | get_handle () const |
| Returns the OpenGL program object handle. | |
| std::vector< CL_ShaderObject > | get_shaders () const |
| Returns the shaders attached to the program object. | |
| CL_String | get_info_log () const |
| Returns the current info log for the program object. | |
| int | get_attribute_count () const |
| Returns the count of active attributes. | |
| std::vector< CL_ProgramAttribute > | get_attributes () const |
| Returns the active attributes. | |
| int | get_attribute_location (const CL_StringRef &name) const |
| Returns the location of a named active attribute. | |
| int | get_uniform_count () const |
| Returns the count of active uniform variables. | |
| std::vector< CL_ProgramUniform > | get_uniforms () const |
| Returns the active uniforms. | |
| int | get_uniform_location (const CL_StringRef &name) const |
| Returns the location of a named uniform variable. | |
Operations | |
| void | attach (const CL_ShaderObject &obj) |
| Add shader to program object. | |
| void | detach (const CL_ShaderObject &obj) |
| Remove shader from program object. | |
| void | bind_attribute_location (int index, const CL_StringRef &name) |
| Bind attribute to specific location. | |
| bool | link () |
| Link program. | |
| bool | validate () |
| Validate program. | |
| void | set_uniform1i (const CL_StringRef &name, int) |
| Set uniform variable(s). | |
| void | set_uniform2i (const CL_StringRef &name, int, int) |
| Set uniform2i. | |
| void | set_uniform3i (const CL_StringRef &name, int, int, int) |
| void | set_uniform4i (const CL_StringRef &name, int, int, int, int) |
| Set uniform4i. | |
| void | set_uniformiv (const CL_StringRef &name, int size, int count, int *data) |
| Set uniformiv. | |
| void | set_uniform2i (const CL_StringRef &name, CL_Vec2i vec) |
| Set uniform2i. | |
| void | set_uniform3i (const CL_StringRef &name, CL_Vec3i vec) |
| Set uniform3i. | |
| void | set_uniform4i (const CL_StringRef &name, CL_Vec4i vec) |
| Set uniform4i. | |
| void | set_uniform2s (const CL_StringRef &name, CL_Vec2s vec) |
| Set uniform2s. | |
| void | set_uniform3s (const CL_StringRef &name, CL_Vec3s vec) |
| Set uniform3s. | |
| void | set_uniform4s (const CL_StringRef &name, CL_Vec4s vec) |
| Set uniform4s. | |
| void | set_uniform2b (const CL_StringRef &name, CL_Vec2b vec) |
| Set uniform2b. | |
| void | set_uniform3b (const CL_StringRef &name, CL_Vec3b vec) |
| Set uniform3b. | |
| void | set_uniform4b (const CL_StringRef &name, CL_Vec4b vec) |
| Set uniform4b. | |
| void | set_uniformiv (const CL_StringRef &name, int count, CL_Vec2i *data) |
| Set uniformiv. | |
| void | set_uniformiv (const CL_StringRef &name, int count, CL_Vec3i *data) |
| Set uniformiv. | |
| void | set_uniformiv (const CL_StringRef &name, int count, CL_Vec4i *data) |
| Set uniformiv. | |
| void | set_uniform1f (const CL_StringRef &name, float) |
| void | set_uniform2f (const CL_StringRef &name, float, float) |
| Set uniform2f. | |
| void | set_uniform3f (const CL_StringRef &name, float, float, float) |
| void | set_uniform4f (const CL_StringRef &name, float, float, float, float) |
| Set uniform4f. | |
| void | set_uniformfv (const CL_StringRef &name, int size, int count, float *data) |
| Set uniformfv. | |
| void | set_uniform2f (const CL_StringRef &name, CL_Vec2f vec) |
| Set uniform2f. | |
| void | set_uniform3f (const CL_StringRef &name, CL_Vec3f vec) |
| Set uniform3f. | |
| void | set_uniform4f (const CL_StringRef &name, CL_Vec4f vec) |
| Set uniform4f. | |
| void | set_uniformfv (const CL_StringRef &name, int count, CL_Vec2f *data) |
| Set uniformfv. | |
| void | set_uniformfv (const CL_StringRef &name, int count, CL_Vec3f *data) |
| Set uniformfv. | |
| void | set_uniformfv (const CL_StringRef &name, int count, CL_Vec4f *data) |
| Set uniformfv. | |
| void | set_uniform_matrix (const CL_StringRef &name, int size, int count, bool transpose, float *data) |
| Set uniform matrices. | |
| void | set_uniform_matrix (const CL_StringRef &name, CL_Mat2f matrix) |
| Set uniform matrix. | |
| void | set_uniform_matrix (const CL_StringRef &name, CL_Mat3f matrix) |
| Set uniform matrix. | |
| void | set_uniform_matrix (const CL_StringRef &name, CL_Mat4f matrix) |
| Set uniform matrix. | |
| void | set_uniform_matrix (const CL_StringRef &name, int count, CL_Mat2f *matrix) |
| Set uniform matrix. | |
| void | set_uniform_matrix (const CL_StringRef &name, int count, CL_Mat3f *matrix) |
| Set uniform matrix. | |
| void | set_uniform_matrix (const CL_StringRef &name, int count, CL_Mat4f *matrix) |
| Set uniform matrix. | |
The shader objects that are to be used by programmable stages of OpenGL are collected together to form a program object. CL_ProgramObject is ClanLib's C++ interface to OpenGL program objects.
To construct a program object programatically, the procedure is as follows:
CL_ShaderObject vertex_shader(cl_shadertype_vertex, vertex_glsl_sourcecode);
CL_ShaderObject fragment_shader(cl_shadertype_fragment, fragment_glsl_sourcecode);
CL_ProgramObject program;
program.attach(vertex_shader);
program.attach(fragment_shader);
program.link();
For more information about program objects, see the OpenGL 2.0 specification at www.opengl.org. Documentation about the OpenGL Shader Language (GLSL) is also available from www.opengl.org.
|
|
Construct OpenGL program object.
|
|
|
Constructs a ProgramObject.
|
|
|
Constructs a ProgramObject.
|
|
|
|
|
|
Add shader to program object.
|
|
||||||||||||
|
Bind attribute to specific location. This function must be called before linking. |
|
|
Remove shader from program object.
|
|
|
Returns the count of active attributes.
|
|
|
Returns the location of a named active attribute.
|
|
|
Returns the active attributes.
|
|
|
Returns the OpenGL program object handle.
|
|
|
Returns the current info log for the program object.
|
|
|
Returns the shaders attached to the program object.
|
|
|
Returns the count of active uniform variables.
|
|
|
Returns the location of a named uniform variable.
|
|
|
Returns the active uniforms.
|
|
|
Returns true if the Program object is a dummy.
|
|
|
Link program. If the linking fails, get_info_log() will return the link log. |
|
||||||||||||
|
Load.
|
|
||||||||||||||||
|
Load.
|
|
||||||||||||
|
Load.
|
|
||||||||||||||||
|
Load.
|
|
||||||||||||||||||||
|
Load.
|
|
||||||||||||||||
|
Load.
|
|
||||||||||||||||
|
Load.
|
|
||||||||||||
|
Load and link.
|
|
||||||||||||||||
|
Load and link.
|
|
||||||||||||
|
Load and link.
|
|
||||||||||||||||
|
Load and link.
|
|
||||||||||||||||||||
|
Load and link.
|
|
||||||||||||||||
|
Load and link.
|
|
||||||||||||
|
|
|
||||||||||||
|
Set uniform variable(s).
|
|
||||||||||||
|
Set uniform2b.
|
|
||||||||||||
|
Set uniform2f.
|
|
||||||||||||||||
|
Set uniform2f.
|
|
||||||||||||
|
Set uniform2i.
|
|
||||||||||||||||
|
Set uniform2i.
|
|
||||||||||||
|
Set uniform2s.
|
|
||||||||||||
|
Set uniform3b.
|
|
||||||||||||
|
Set uniform3f.
|
|
||||||||||||||||||||
|
|
|
||||||||||||
|
Set uniform3i.
|
|
||||||||||||||||||||
|
|
|
||||||||||||
|
Set uniform3s.
|
|
||||||||||||
|
Set uniform4b.
|
|
||||||||||||
|
Set uniform4f.
|
|
||||||||||||||||||||||||
|
Set uniform4f.
|
|
||||||||||||
|
Set uniform4i.
|
|
||||||||||||||||||||||||
|
Set uniform4i.
|
|
||||||||||||
|
Set uniform4s.
|
|
||||||||||||||||
|
Set uniform matrix.
|
|
||||||||||||||||
|
Set uniform matrix.
|
|
||||||||||||||||
|
Set uniform matrix.
|
|
||||||||||||
|
Set uniform matrix.
|
|
||||||||||||
|
Set uniform matrix.
|
|
||||||||||||
|
Set uniform matrix.
|
|
||||||||||||||||||||||||
|
Set uniform matrices.
|
|
||||||||||||||||
|
Set uniformfv.
|
|
||||||||||||||||
|
Set uniformfv.
|
|
||||||||||||||||
|
Set uniformfv.
|
|
||||||||||||||||||||
|
Set uniformfv.
|
|
||||||||||||||||
|
Set uniformiv.
|
|
||||||||||||||||
|
Set uniformiv.
|
|
||||||||||||||||
|
Set uniformiv.
|
|
||||||||||||||||||||
|
Set uniformiv.
|
|
|
Validate program. If the validation fails, get_info_log() will return the validation log. |
1.4.6