Helper class that encapsulates vertex attribute functionality. More...
#include </home/chochlik/devel/oglplus/include/oglplus/vertex_attrib.hpp>
Public Member Functions | |
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... | |
Helper class that encapsulates vertex attribute functionality.
void oglplus::VertexAttribOps::BindLocation | ( | const ProgramOps & | program, |
const String & | identifier | ||
) | const |
Bind the vertex attribute location.
References OGLPLUS_CHECK.
void oglplus::VertexAttribOps::Divisor | ( | GLuint | divisor) | const |
Set the vertex attrib divisor.
Requires OpenGL 3.3.
References OGLPLUS_CHECK.
|
static |
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.
|
static |
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().
VertexAttribSlot oglplus::VertexAttribOps::Location | ( | void | ) | const |
Returns the location of this vertex attribute in a program.
|
static |
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.
|
static |
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.
|
static |
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().