Encapsulates vertex attribute functionality. More...
#include </home/chochlik/devel/oglplus/include/oglplus/vertex_attrib.hpp>
Public Member Functions | |
VertexAttrib (VertexAttribSlot location) | |
References the vertex attribute array at location . More... | |
VertexAttrib (const ProgramOps &program, const GLchar *identifier) | |
References the vertex attribute identifier of the program . More... | |
VertexAttrib (const ProgramOps &program, const String &identifier) | |
References the vertex attribute identifier of the program . | |
void | Set (T value) const |
Set the value of the vertex attribute. More... | |
void | operator= (T value) const |
Set the value of the vertex attribute. More... | |
VertexAttribSlot | Location (void) const |
Returns the location of this vertex attribute in a program. More... | |
void | BindLocation (const ProgramOps &program, const String &identifier) const |
Bind the vertex attribute location. More... | |
void | Divisor (GLuint divisor) const |
Set the vertex attrib divisor. More... | |
Static Public Member Functions | |
static VertexAttribSlot | GetLocation (const ProgramOps &program, const String &identifier) |
Finds the vertex attribute location, throws on failure. More... | |
template<typename... ProgramOps_> | |
static VertexAttribSlot | GetCommonLocation (const GLchar *identifier, const ProgramOps &program, const ProgramOps_ &...programs) |
Returns vertex attr. location in multiple programs if it's consistent. More... | |
static bool | QueryLocation (const ProgramOps &program, const String &identifier, VertexAttribSlot &location) |
Queries the vertex attribute location in a program. More... | |
static _common_location_query | QueryCommonLocation (const String &identifier, VertexAttribSlot &location) |
Allows to query the vertex attribute location in multiple programs. More... | |
template<typename... ProgramOps_> | |
static bool | QueryCommonLocation (const GLchar *identifier, VertexAttribSlot &location, const ProgramOps &program, const ProgramOps_ &...programs) |
Queries the vertex attribute location in multiple programs. More... | |
Encapsulates vertex attribute functionality.
oglplus::VertexAttrib< T >::VertexAttrib | ( | VertexAttribSlot | location) |
References the vertex attribute array at location
.
oglplus::VertexAttrib< T >::VertexAttrib | ( | const ProgramOps & | program, |
const GLchar * | identifier | ||
) |
References the vertex attribute identifier
of the program
.
|
inherited |
Bind the vertex attribute location.
References OGLPLUS_CHECK.
|
inherited |
Set the vertex attrib divisor.
Requires OpenGL 3.3.
References OGLPLUS_CHECK.
|
staticinherited |
Returns vertex attr. location in multiple programs if it's consistent.
Finds the location of the input vertex attribute specified by identifier
in every program in programs
. Throws Error if no such attribute exists or if it is not active in some of the programs or if the attribute has different locations in different programs. Otherwise returns the vertex attribute position.
|
staticinherited |
Finds the vertex attribute location, throws on failure.
Finds the location of the input vertex attribute specified by identifier
in a program
. Throws if no such attribute exists or if it is not active. For a non-throwing version see QueryLocation().
|
inherited |
Returns the location of this vertex attribute in a program.
void oglplus::VertexAttrib< T >::operator= | ( | T | value) | const |
Set the value of the vertex attribute.
References oglplus::VertexAttrib< T >::Set().
|
staticinherited |
Allows to query the vertex attribute location
in multiple programs.
This function returns a temporary object that allows to query the location
of the specified identifier
in several programs. The returned object has two functions called In
and And
which are equivalent and take a Program as the argument. Both these functions return in turn a new instance of the temporary which allows to check in another program, and so on. The temporary is also convertible to bool
indicating whether a common location was found in all programs in the chain.
|
staticinherited |
Queries the vertex attribute location
in multiple programs.
Finds the location
of the input vertex attribute specified by identifier
in every program in programs
. Returns false if no such attribute exists or if it is not active in some of the programs or if the attribute has different locations in different programs. Otherwise stores the vertex attribute position in location
and returns true.
|
staticinherited |
Queries the vertex attribute location
in a program.
Finds the location
of the input vertex attribute specified by identifier
in a program
. Returns false if no such attribute exists or if it is not active, otherwise stores the vertex attribute position in location
and returns true. For a throwing version see GetLocation().
void oglplus::VertexAttrib< T >::Set | ( | T | value) | const |
Set the value of the vertex attribute.
Referenced by oglplus::VertexAttrib< T >::operator=().