Encapsulates vertex attribute array functionality. More...
#include </home/chochlik/devel/oglplus/include/oglplus/vertex_attrib.hpp>
Public Member Functions | |
VertexAttribArray (VertexAttribSlot location) | |
References the vertex attribute array at location . More... | |
VertexAttribArray (const ProgramOps &program, const GLchar *identifier) | |
References the vertex attrib array identifier of the program . More... | |
VertexAttribArray (const ProgramOps &program, const String &identifier) | |
References the vertex attrib array identifier of the program . More... | |
const VertexAttribArray & | Setup (GLint values_per_vertex, DataType data_type) const |
Setup the properties of this vertex attribute array. More... | |
template<typename T > | |
const VertexAttribArray & | Setup (GLuint n=1) const |
Setup the properties of this vertex attribute array. More... | |
const VertexAttribArray & | Pointer (GLint values_per_vertex, DataType data_type, bool normalized, GLsizei stride, const void *pointer) const |
Setup the properties of this vertex attribute array. More... | |
const VertexAttribArray & | IPointer (GLuint values_per_vertex, DataType data_type, GLsizei stride, const void *pointer) const |
Setup the properties of this vertex attribute array. More... | |
const VertexAttribArray & | LPointer (GLuint values_per_vertex, DataType data_type, GLsizei stride, const void *pointer) const |
Setup the properties of this vertex attribute array. More... | |
const VertexAttribArray & | Format (GLint values_per_vertex, DataType data_type, bool normalized, GLuint relative_offset) const |
Setup the format of this vertex attribute array. More... | |
const VertexAttribArray & | IFormat (GLint values_per_vertex, DataType data_type, GLuint relative_offset) const |
Setup the format of this vertex attribute array. More... | |
const VertexAttribArray & | LFormat (GLint values_per_vertex, DataType data_type, GLuint relative_offset) const |
Setup the format of this vertex attribute array. More... | |
const VertexAttribArray & | Enable (void) const |
Enables this vertex attribute array. More... | |
const VertexAttribArray & | Disable (void) const |
Disables this vertex attribute array. 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 array functionality.
oglplus::VertexAttribArray::VertexAttribArray | ( | VertexAttribSlot | location) |
References the vertex attribute array at location
.
oglplus::VertexAttribArray::VertexAttribArray | ( | const ProgramOps & | program, |
const GLchar * | identifier | ||
) |
References the vertex attrib array identifier
of the program
.
oglplus::VertexAttribArray::VertexAttribArray | ( | const ProgramOps & | program, |
const String & | identifier | ||
) |
References the vertex attrib array identifier
of the program
.
|
inherited |
Bind the vertex attribute location.
References OGLPLUS_CHECK.
const VertexAttribArray& oglplus::VertexAttribArray::Disable | ( | void | ) | const |
Disables this vertex attribute array.
References OGLPLUS_VERIFY.
|
inherited |
Set the vertex attrib divisor.
Requires OpenGL 3.3.
References OGLPLUS_CHECK.
const VertexAttribArray& oglplus::VertexAttribArray::Enable | ( | void | ) | const |
Enables this vertex attribute array.
References OGLPLUS_VERIFY.
const VertexAttribArray& oglplus::VertexAttribArray::Format | ( | GLint | values_per_vertex, |
DataType | data_type, | ||
bool | normalized, | ||
GLuint | relative_offset | ||
) | const |
Setup the format of this vertex attribute array.
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().
const VertexAttribArray& oglplus::VertexAttribArray::IFormat | ( | GLint | values_per_vertex, |
DataType | data_type, | ||
GLuint | relative_offset | ||
) | const |
Setup the format of this vertex attribute array.
References OGLPLUS_CHECK.
const VertexAttribArray& oglplus::VertexAttribArray::IPointer | ( | GLuint | values_per_vertex, |
DataType | data_type, | ||
GLsizei | stride, | ||
const void * | pointer | ||
) | const |
Setup the properties of this vertex attribute array.
References OGLPLUS_CHECK.
const VertexAttribArray& oglplus::VertexAttribArray::LFormat | ( | GLint | values_per_vertex, |
DataType | data_type, | ||
GLuint | relative_offset | ||
) | const |
Setup the format of this vertex attribute array.
References OGLPLUS_CHECK.
|
inherited |
Returns the location of this vertex attribute in a program.
const VertexAttribArray& oglplus::VertexAttribArray::LPointer | ( | GLuint | values_per_vertex, |
DataType | data_type, | ||
GLsizei | stride, | ||
const void * | pointer | ||
) | const |
Setup the properties of this vertex attribute array.
References OGLPLUS_CHECK.
const VertexAttribArray& oglplus::VertexAttribArray::Pointer | ( | GLint | values_per_vertex, |
DataType | data_type, | ||
bool | normalized, | ||
GLsizei | stride, | ||
const void * | pointer | ||
) | const |
Setup the properties of this vertex attribute array.
References OGLPLUS_CHECK.
|
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().
const VertexAttribArray& oglplus::VertexAttribArray::Setup | ( | GLint | values_per_vertex, |
DataType | data_type | ||
) | const |
Setup the properties of this vertex attribute array.
Equivalent to
if data_type
is DataType::Float or to
if data_type
is DataType::Double or to
otherwise.
References oglplus::Double, and oglplus::Float.
const VertexAttribArray& oglplus::VertexAttribArray::Setup | ( | GLuint | n = 1 ) | const |
Setup the properties of this vertex attribute array.
References oglplus::T.