Program operations wrapper helper class. More...
#include </home/chochlik/devel/oglplus/include/oglplus/program.hpp>
Classes | |
class | ActiveUniformBlockInfo |
Information about a active uniform block. More... | |
class | ActiveVariableInfo |
Information about a single active vertex attribute or uniform. More... | |
Public Types | |
typedef Unspecified | InterfaceContext |
Helper class for efficient iteration of Program interface items. More... | |
typedef Range< ProgramResource > | ActiveResourceRange |
The type of the range for traversing program resource information. | |
typedef Range< ActiveVariableInfo > | ActiveAttribRange |
The type of the range for traversing active vertex attributes. | |
typedef Range< ActiveVariableInfo > | ActiveUniformRange |
The type of the range for traversing active uniforms. | |
typedef Range< ActiveVariableInfo > | ActiveSubroutineUniformRange |
The type of the range for traversing active subroutine uniforms. | |
typedef Range< ActiveVariableInfo > | TransformFeedbackVaryingRange |
The type of the range for traversing transform feedback varyings. | |
typedef Range< Managed< Shader > > | ShaderRange |
The type of the range for traversing program's shaders. | |
typedef Range < ActiveUniformBlockInfo > | ActiveUniformRange |
The type of the range for traversing active uniform blocks. | |
Public Member Functions | |
ProgramOps & | AttachShader (const ShaderOps &shader) |
Attaches the shader to this program. More... | |
ProgramOps & | AttachShaders (const Group< Shader > &shaders) |
Attaches a group of shaders to this program. | |
ProgramOps & | DetachShader (const ShaderOps &shader) |
Detaches the shader from this program. More... | |
bool | IsLinked (void) const |
Returns true if the program is already linked, false otherwise. More... | |
String | GetInfoLog (void) const |
Returns the linker output if the program is linked. More... | |
ProgramOps & | Link (void) |
Links this shading language program. More... | |
bool | IsValid (void) const |
Returns true if the program is validated, false otherwise. More... | |
ProgramOps & | Validate (void) |
Validates this shading language program. More... | |
const ProgramOps & | Use (void) const |
Uses this shading language program. More... | |
void | TransformFeedbackVaryings (GLsizei count, const GLchar **varyings, TransformFeedbackMode mode) |
Sets the variables that will be captured during transform feedback. More... | |
void | TransformFeedbackVarying (const GLchar *varying) |
Sets the variable that will be captured during transform feedback. More... | |
void | TransformFeedbackVaryings (const std::vector< String > &varyings, TransformFeedbackMode mode) const |
Sets the variables that will be captured during transform feedback. More... | |
InterfaceContext | ActiveResourceContext (ProgramInterface intf) const |
Returns the context for traversal of Program's active resources. More... | |
ActiveResourceRange | ActiveResources (ProgramInterface intf) const |
Returns a range allowing to do the traversal of interface's resources. More... | |
InterfaceContext | ActiveAttribContext (void) const |
Returns the context for traversal of Program's active vertex attributes. More... | |
ActiveAttribRange | ActiveAttribs (void) const |
Returns a range allowing to do the traversal of active attributes. More... | |
InterfaceContext | ActiveUniformContext (void) const |
Returns the context for traversal of Program's active uniforms. More... | |
ActiveUniformRange | ActiveUniforms (void) const |
Returns a range allowing to do the traversal of active uniforms. More... | |
InterfaceContext | ActiveSubroutineContext (ShaderType stage) const |
Returns the context for traversal of Program's active subroutines. More... | |
ActiveSubroutineRange | ActiveSubroutines (ShaderType stage) const |
Returns a range allowing to do the traversal of subroutines. More... | |
InterfaceContext | ActiveSubroutineUniformContext (ShaderType stage) const |
Returns the context for traversal of Program's active subr. uniforms. More... | |
ActiveSubroutineUniformRange | ActiveSubroutineUniforms (ShaderType stage) const |
Returns a range allowing to do the traversal of subroutine uniforms. More... | |
InterfaceContext | TransformFeedbackVaryingContext (void) const |
Returns the context for traversal of Program's active TFB varyings. More... | |
TransformFeedbackVaryingRange | TransformFeedbackVaryings (void) const |
Returns a range allowing to do the traversal of feedback varyings. More... | |
ShaderRange | AttachedShaders (void) const |
Returns a range allowing to traverse shaders attached to this program. | |
ActiveUniformBlockRange | ActiveUniformBlocks (void) const |
Returns a range allowing to do the traversal of active attributes. More... | |
ProgramOps & | MakeSeparable (bool para=true) |
Makes this program separable. More... | |
ProgramOps & | MakeRetrievable (bool para=true) |
Makes this program retrievable in binary form. More... | |
void | GetBinary (std::vector< GLubyte > &binary, GLenum &format) const |
Returns this programs binary representation. More... | |
void | Binary (const std::vector< GLubyte > &binary, GLenum format) |
Allows to specify to program code in binary form. More... | |
TransformFeedbackMode | TransformFeedbackBufferMode (void) const |
Returns the transform feedback buffer mode. More... | |
GLint | GeometryVerticesOut (void) const |
Returns the number of vertices that the geometry shader will output. More... | |
GLint | GeometryShaderInvocations (void) const |
Returns the number of invocations of geometry shader per primitive. More... | |
PrimitiveType | GeometryInputType (void) const |
Returns the geometry shader input primitive type. More... | |
PrimitiveType | GeometryOutputType (void) const |
Returns the geometry shader output primitive type. More... | |
FaceOrientation | TessGenVertexOrder (void) const |
Returns the vertex order in tesselation evaluation shader. More... | |
TessGenPrimitiveType | TessGenMode (void) const |
Returns the tesselation generator output primitive type. More... | |
TessGenPrimitiveSpacing | TessGenSpacing (void) const |
Returns the tesselation generator primitive spacing mode. More... | |
bool | TessGenPointMode (void) const |
Returns true if point mode is enabled in tesslation eval. shader. More... | |
void | BindLocation (const VertexAttribOps &vertex_attrib, const GLchar *identifier) const |
Binds the location of a SL variable to the vertex_attrib. More... | |
Static Public Member Functions | |
static void | UseNone (void) |
Deactivates the currently active/used program (if any) More... | |
Program operations wrapper helper class.
This class implements OpenGL shading language program operations.
Program
instead.Helper class for efficient iteration of Program interface items.
Instances of this class are created by a program for its specific interfaces (uniform, vertex attributes, subroutines, etc.) or stages (vertex, geometry, fragment, etc.). Instances of an interface context can be used (mostly internally) for efficient iteration of individual items of a particular interface (uniforms, subroutines, etc.). Contexts for various programs and various interfaces are not interchangeable. The InterfaceContext type should be treated as opaque and only used with appropriate functions.
InterfaceContext oglplus::ProgramOps::ActiveAttribContext | ( | void | ) | const |
Returns the context for traversal of Program's active vertex attributes.
ActiveAttribRange oglplus::ProgramOps::ActiveAttribs | ( | void | ) | const |
InterfaceContext oglplus::ProgramOps::ActiveResourceContext | ( | ProgramInterface | intf) | const |
Returns the context for traversal of Program's active resources.
ActiveResourceRange oglplus::ProgramOps::ActiveResources | ( | ProgramInterface | intf) | const |
Returns a range allowing to do the traversal of interface's resources.
This instance of Program must be kept alive during the whole lifetime of the returned range, i.e. the returned range must not be used after the Program goes out of scope and is destroyed.
Error |
InterfaceContext oglplus::ProgramOps::ActiveSubroutineContext | ( | ShaderType | stage) | const |
Returns the context for traversal of Program's active subroutines.
ActiveSubroutineRange oglplus::ProgramOps::ActiveSubroutines | ( | ShaderType | stage) | const |
Returns a range allowing to do the traversal of subroutines.
This instance of Program must be kept alive during the whole lifetime of the returned range, i.e. the returned range must not be used after the Program goes out of scope and is destroyed.
Error | Requires OpenGL 4.0 or the GL_ARB_shader_subroutine extension. |
InterfaceContext oglplus::ProgramOps::ActiveSubroutineUniformContext | ( | ShaderType | stage) | const |
Returns the context for traversal of Program's active subr. uniforms.
ActiveSubroutineUniformRange oglplus::ProgramOps::ActiveSubroutineUniforms | ( | ShaderType | stage) | const |
Returns a range allowing to do the traversal of subroutine uniforms.
This instance of Program must be kept alive during the whole lifetime of the returned range, i.e. the returned range must not be used after the Program goes out of scope and is destroyed.
Error | Requires OpenGL 4.0 or the GL_ARB_shader_subroutine extension. |
ActiveUniformBlockRange oglplus::ProgramOps::ActiveUniformBlocks | ( | void | ) | const |
InterfaceContext oglplus::ProgramOps::ActiveUniformContext | ( | void | ) | const |
Returns the context for traversal of Program's active uniforms.
ActiveUniformRange oglplus::ProgramOps::ActiveUniforms | ( | void | ) | const |
ProgramOps& oglplus::ProgramOps::AttachShader | ( | const ShaderOps & | shader) |
Attaches the shader to this program.
void oglplus::ProgramOps::Binary | ( | const std::vector< GLubyte > & | binary, |
GLenum | format | ||
) |
Allows to specify to program code in binary form.
Requires OpenGL 4.1 or the GL_ARB_get_program_binary extension.
void oglplus::ProgramOps::BindLocation | ( | const VertexAttribOps & | vertex_attrib, |
const GLchar * | identifier | ||
) | const |
Binds the location of a SL variable to the vertex_attrib.
This function binds the location of the vertex attribute vertex_attrib
to the shader variable identified by identifier
.
References OGLPLUS_CHECK.
ProgramOps& oglplus::ProgramOps::DetachShader | ( | const ShaderOps & | shader) |
Detaches the shader from this program.
PrimitiveType oglplus::ProgramOps::GeometryInputType | ( | void | ) | const |
Returns the geometry shader input primitive type.
Requires OpenGL 3.2.
GL_GEOMETRY_INPUT_TYPE
PrimitiveType oglplus::ProgramOps::GeometryOutputType | ( | void | ) | const |
Returns the geometry shader output primitive type.
Requires OpenGL 3.2.
GL_GEOMETRY_OUTPUT_TYPE
GLint oglplus::ProgramOps::GeometryShaderInvocations | ( | void | ) | const |
Returns the number of invocations of geometry shader per primitive.
Requires OpenGL 4.1 or the GL_ARB_gpu_shader5 extension.
GL_GEOMETRY_SHADER_INVOCATIONS
GLint oglplus::ProgramOps::GeometryVerticesOut | ( | void | ) | const |
Returns the number of vertices that the geometry shader will output.
GL_GEOMETRY_VERTICES_OUT
void oglplus::ProgramOps::GetBinary | ( | std::vector< GLubyte > & | binary, |
GLenum & | format | ||
) | const |
Returns this programs binary representation.
Requires OpenGL 4.1 or the GL_ARB_get_program_binary extension.
GL_PROGRAM_BINARY_LENGTH
String oglplus::ProgramOps::GetInfoLog | ( | void | ) | const |
Returns the linker output if the program is linked.
bool oglplus::ProgramOps::IsLinked | ( | void | ) | const |
Returns true if the program is already linked, false otherwise.
GL_LINK_STATUS
Referenced by Use().
bool oglplus::ProgramOps::IsValid | ( | void | ) | const |
Returns true if the program is validated, false otherwise.
GL_VALIDATE_STATUS
ProgramOps& oglplus::ProgramOps::Link | ( | void | ) |
Links this shading language program.
ProgramOps& oglplus::ProgramOps::MakeRetrievable | ( | bool | para = true ) |
Makes this program retrievable in binary form.
Requires OpenGL 4.1 or the GL_ARB_get_program_binary extension.
ProgramOps& oglplus::ProgramOps::MakeSeparable | ( | bool | para = true ) |
Makes this program separable.
Requires OpenGL 4.1 or the GL_ARB_separate_shader_objects extension.
TessGenPrimitiveType oglplus::ProgramOps::TessGenMode | ( | void | ) | const |
Returns the tesselation generator output primitive type.
Requires OpenGL 4.0 or the GL_ARB_tessellation_shader extension.
GL_TESS_GEN_MODE
bool oglplus::ProgramOps::TessGenPointMode | ( | void | ) | const |
Returns true if point mode is enabled in tesslation eval. shader.
Requires OpenGL 4.0 or the GL_ARB_tessellation_shader extension.
GL_TESS_GEN_POINT_MODE
TessGenPrimitiveSpacing oglplus::ProgramOps::TessGenSpacing | ( | void | ) | const |
Returns the tesselation generator primitive spacing mode.
Requires OpenGL 4.0 or the GL_ARB_tessellation_shader extension.
GL_TESS_GEN_SPACING
FaceOrientation oglplus::ProgramOps::TessGenVertexOrder | ( | void | ) | const |
Returns the vertex order in tesselation evaluation shader.
Requires OpenGL 4.0 or the GL_ARB_tessellation_shader extension.
GL_TESS_GEN_VERTEX_ORDER
TransformFeedbackMode oglplus::ProgramOps::TransformFeedbackBufferMode | ( | void | ) | const |
Returns the transform feedback buffer mode.
GL_TRANSFORM_FEEDBACK_BUFFER_MODE
void oglplus::ProgramOps::TransformFeedbackVarying | ( | const GLchar * | varying) |
Sets the variable that will be captured during transform feedback.
Error |
References oglplus::SeparateAttribs, and TransformFeedbackVaryings().
InterfaceContext oglplus::ProgramOps::TransformFeedbackVaryingContext | ( | void | ) | const |
Returns the context for traversal of Program's active TFB varyings.
void oglplus::ProgramOps::TransformFeedbackVaryings | ( | GLsizei | count, |
const GLchar ** | varyings, | ||
TransformFeedbackMode | mode | ||
) |
Sets the variables that will be captured during transform feedback.
Error |
void oglplus::ProgramOps::TransformFeedbackVaryings | ( | const std::vector< String > & | varyings, |
TransformFeedbackMode | mode | ||
) | const |
Sets the variables that will be captured during transform feedback.
Error |
TransformFeedbackVaryingRange oglplus::ProgramOps::TransformFeedbackVaryings | ( | void | ) | const |
Returns a range allowing to do the traversal of feedback varyings.
This instance of Program must be kept alive during the whole lifetime of the returned range, i.e. the returned range must not be used after the Program goes out of scope and is destroyed.
Error |
Referenced by TransformFeedbackVarying().
const ProgramOps& oglplus::ProgramOps::Use | ( | void | ) | const |
Uses this shading language program.
References IsLinked(), and OGLPLUS_VERIFY.
|
static |
Deactivates the currently active/used program (if any)
References OGLPLUS_VERIFY.
ProgramOps& oglplus::ProgramOps::Validate | ( | void | ) |
Validates this shading language program.
Error | ValidationError |