Class wrapping program functions (with direct state access) 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 | |
ObjectOps & | AttachShader (ShaderName shader) |
Attaches the shader to this program. More... | |
ObjectOps & | AttachShaders (const Sequence< ShaderName > &shaders) |
Attaches a group of shaders to this program. | |
ObjectOps & | DetachShader (ShaderName 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... | |
ObjectOps & | Link (void) |
Links this shading language program. More... | |
ObjectOps & | Build (void) |
builds this shading language program More... | |
ObjectOps & | BuildInclude (GLsizei count, const GLchar *const *paths, const GLint *lengths) |
builds this shading language program using specified include paths More... | |
bool | IsValid (void) const |
Returns true if the program is validated, false otherwise. More... | |
ObjectOps & | Validate (void) |
Validates 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... | |
ObjectOps & | MakeSeparable (bool para=true) |
Makes this program separable. More... | |
ObjectOps & | 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 (VertexAttribSlot vertex_attrib_slot, StrCRef identifier) |
Binds the location of a SL variable to the vertex_attrib. More... | |
void | Bind (void) const |
Binds (uses) this program object. More... | |
void | Use (void) const |
Uses this program object. More... | |
Static Public Member Functions | |
static void | Bind (ProgramName program) |
Binds (uses) the specified program . More... | |
static ProgramName | Binding (void) |
Returns the currently bound (active) Program. More... | |
Class wrapping program functions (with direct state access)
typedef Unspecified oglplus::ObjectOps< tag::DirectState, tag::Program >::InterfaceContext |
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::ObjectOps< tag::DirectState, tag::Program >::ActiveAttribContext | ( | void | ) | const |
Returns the context for traversal of Program's active vertex attributes.
ActiveAttribRange oglplus::ObjectOps< tag::DirectState, tag::Program >::ActiveAttribs | ( | void | ) | const |
Returns a range allowing to do the traversal of active attributes.
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::ObjectOps< tag::DirectState, tag::Program >::ActiveResourceContext | ( | ProgramInterface | intf | ) | const |
Returns the context for traversal of Program's active resources.
ActiveResourceRange oglplus::ObjectOps< tag::DirectState, tag::Program >::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::ObjectOps< tag::DirectState, tag::Program >::ActiveSubroutineContext | ( | ShaderType | stage | ) | const |
Returns the context for traversal of Program's active subroutines.
ActiveSubroutineRange oglplus::ObjectOps< tag::DirectState, tag::Program >::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::ObjectOps< tag::DirectState, tag::Program >::ActiveSubroutineUniformContext | ( | ShaderType | stage | ) | const |
Returns the context for traversal of Program's active subr. uniforms.
ActiveSubroutineUniformRange oglplus::ObjectOps< tag::DirectState, tag::Program >::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::ObjectOps< tag::DirectState, tag::Program >::ActiveUniformBlocks | ( | void | ) | const |
Returns a range allowing to do the traversal of active attributes.
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::ObjectOps< tag::DirectState, tag::Program >::ActiveUniformContext | ( | void | ) | const |
Returns the context for traversal of Program's active uniforms.
ActiveUniformRange oglplus::ObjectOps< tag::DirectState, tag::Program >::ActiveUniforms | ( | void | ) | const |
Returns a range allowing to do the traversal of active 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 |
ObjectOps& oglplus::ObjectOps< tag::DirectState, tag::Program >::AttachShader | ( | ShaderName | shader | ) |
Attaches the shader to this program.
void oglplus::ObjectOps< tag::DirectState, tag::Program >::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.
|
staticinherited |
Binds (uses) the specified program
.
References oglplus::GetGLName().
|
inherited |
Binds (uses) this program object.
|
staticinherited |
Returns the currently bound (active) Program.
void oglplus::ObjectOps< tag::DirectState, tag::Program >::BindLocation | ( | VertexAttribSlot | vertex_attrib_slot, |
StrCRef | identifier | ||
) |
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::StrCRefTpl< Char >::c_str(), and oglplus::Program.
ObjectOps& oglplus::ObjectOps< tag::DirectState, tag::Program >::Build | ( | void | ) |
builds this shading language program
This function checks if all attached shaders are compiled and if they are not the it compiles them and then links this Program.
ObjectOps& oglplus::ObjectOps< tag::DirectState, tag::Program >::BuildInclude | ( | GLsizei | count, |
const GLchar *const * | paths, | ||
const GLint * | lengths | ||
) |
builds this shading language program using specified include paths
This function checks if all attached shaders are compiled and if they are not the it compiles them and then links this Program.
ObjectOps& oglplus::ObjectOps< tag::DirectState, tag::Program >::DetachShader | ( | ShaderName | shader | ) |
Detaches the shader from this program.
PrimitiveType oglplus::ObjectOps< tag::DirectState, tag::Program >::GeometryInputType | ( | void | ) | const |
Returns the geometry shader input primitive type.
Requires OpenGL 3.2.
GL_GEOMETRY_INPUT_TYPE
PrimitiveType oglplus::ObjectOps< tag::DirectState, tag::Program >::GeometryOutputType | ( | void | ) | const |
Returns the geometry shader output primitive type.
Requires OpenGL 3.2.
GL_GEOMETRY_OUTPUT_TYPE
GLint oglplus::ObjectOps< tag::DirectState, tag::Program >::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::ObjectOps< tag::DirectState, tag::Program >::GeometryVerticesOut | ( | void | ) | const |
Returns the number of vertices that the geometry shader will output.
GL_GEOMETRY_VERTICES_OUT
void oglplus::ObjectOps< tag::DirectState, tag::Program >::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::ObjectOps< tag::DirectState, tag::Program >::GetInfoLog | ( | void | ) | const |
Returns the linker output if the program is linked.
bool oglplus::ObjectOps< tag::DirectState, tag::Program >::IsLinked | ( | void | ) | const |
Returns true if the program is already linked, false otherwise.
GL_LINK_STATUS
bool oglplus::ObjectOps< tag::DirectState, tag::Program >::IsValid | ( | void | ) | const |
Returns true if the program is validated, false otherwise.
GL_VALIDATE_STATUS
ObjectOps& oglplus::ObjectOps< tag::DirectState, tag::Program >::Link | ( | void | ) |
Links this shading language program.
ObjectOps& oglplus::ObjectOps< tag::DirectState, tag::Program >::MakeRetrievable | ( | bool | para = true | ) |
Makes this program retrievable in binary form.
Requires OpenGL 4.1 or the GL_ARB_get_program_binary extension.
ObjectOps& oglplus::ObjectOps< tag::DirectState, tag::Program >::MakeSeparable | ( | bool | para = true | ) |
Makes this program separable.
Requires OpenGL 4.1 or the GL_ARB_separate_shader_objects extension.
TessGenPrimitiveType oglplus::ObjectOps< tag::DirectState, tag::Program >::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::ObjectOps< tag::DirectState, tag::Program >::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::ObjectOps< tag::DirectState, tag::Program >::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::ObjectOps< tag::DirectState, tag::Program >::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::ObjectOps< tag::DirectState, tag::Program >::TransformFeedbackBufferMode | ( | void | ) | const |
Returns the transform feedback buffer mode.
GL_TRANSFORM_FEEDBACK_BUFFER_MODE
void oglplus::ObjectOps< tag::DirectState, tag::Program >::TransformFeedbackVarying | ( | const GLchar * | varying | ) |
Sets the variable that will be captured during transform feedback.
Error |
References oglplus::SeparateAttribs.
InterfaceContext oglplus::ObjectOps< tag::DirectState, tag::Program >::TransformFeedbackVaryingContext | ( | void | ) | const |
Returns the context for traversal of Program's active TFB varyings.
void oglplus::ObjectOps< tag::DirectState, tag::Program >::TransformFeedbackVaryings | ( | GLsizei | count, |
const GLchar ** | varyings, | ||
TransformFeedbackMode | mode | ||
) |
Sets the variables that will be captured during transform feedback.
Error |
void oglplus::ObjectOps< tag::DirectState, tag::Program >::TransformFeedbackVaryings | ( | const std::vector< String > & | varyings, |
TransformFeedbackMode | mode | ||
) | const |
Sets the variables that will be captured during transform feedback.
Error |
TransformFeedbackVaryingRange oglplus::ObjectOps< tag::DirectState, tag::Program >::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 |
|
inherited |
Uses this program object.
ObjectOps& oglplus::ObjectOps< tag::DirectState, tag::Program >::Validate | ( | void | ) |
Validates this shading language program.
Error | ValidationError |