Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
|
Object representing the layout of one set of related attributes representing (presumably) one object or instance. More...
#include <instance.hpp>
Public Member Functions | |
InstanceLayout (const std::vector< InstanceAttributeDescriptor > &attributeList) | |
Constructs a new instance layout object. | |
std::vector< InstanceAttributeDescriptor > | getAttributeList () const |
Returns this layout's attribute list. | |
std::size_t | computeStride () const |
Computes the stride for this layout, i.e., the number of bytes separating the start of one instance's attributes and the start of the next one's. | |
std::size_t | computeRelativeOffset (std::size_t attributeIndex) const |
Computes the offset of a specific attribute from the start of the instance, in bytes. | |
bool | isSubsetOf (const InstanceLayout &other) const |
Tests whether another InstanceLayout has the same attributes in the same order as this one, where some attributes may be absent from the other. | |
Private Attributes | |
std::vector< InstanceAttributeDescriptor > | mAttributeList |
The list of attribute descriptors that make up this InstanceLayout. | |
Object representing the layout of one set of related attributes representing (presumably) one object or instance.
In implementation it is essentially a list of attribute descriptors. The descriptors are then used to upload data to GPU memory, and also help bind (a subset of) attributes correctly to shaders for some rendering stage.
|
inline |
Constructs a new instance layout object.
attributeList | List of attribute descriptors. |
|
inline |
Computes the offset of a specific attribute from the start of the instance, in bytes.
attributeIndex | The index to the attribute descriptor whose offset we want. |
|
inline |
Computes the stride for this layout, i.e., the number of bytes separating the start of one instance's attributes and the start of the next one's.
|
inline |
Returns this layout's attribute list.
|
inline |
Tests whether another InstanceLayout has the same attributes in the same order as this one, where some attributes may be absent from the other.
other | The layout this one is being compared with. |
true | The other layout is a subset of this one. |
false | The other layout is not a subset of this one. |