|
Photon Engine 2.0.0-beta
A physically based renderer.
|
A general vertex buffer for storing various indexed attributes. More...
#include <IndexedVertexBuffer.h>
Classes | |
| struct | AttributeDeclaration |
| Info for a declared vertex attribute. More... | |
Public Member Functions | |
| IndexedVertexBuffer () | |
| void | declareAttribute (EVertexAttribute attribute, EVertexElement element, std::size_t numElements, bool shouldNormalize=false) |
| Declares a vertex attribute with default layout (AoS). | |
| void | declareAttribute (EVertexAttribute attribute, EVertexElement element, std::size_t numElements, std::size_t strideOffset, std::size_t strideSize, bool shouldNormalize=false) |
| Declares a vertex attribute with custom layout. | |
| void | allocate (std::size_t numVertices) |
| void | setAttribute (EVertexAttribute attribute, std::size_t index, const math::Vector3R &value) |
| void | setAttribute (EVertexAttribute attribute, std::size_t index, const math::Vector2R &value) |
| void | setAttribute (EVertexAttribute attribute, std::size_t index, real value) |
| void | setVertices (const std::byte *srcBytes, std::size_t numBytes, std::size_t dstOffset=0) |
| bool | hasAttribute (EVertexAttribute attribute) const |
| math::Vector3R | getAttribute (EVertexAttribute attribute, std::size_t index) const |
| std::size_t | memoryUsage () const |
| bool | isAllocated () const |
| std::size_t | numVertices () const |
| AttributeDeclaration | getAttributeDeclaration (EVertexAttribute attribute) const |
| Get information for a previously declared attribute. Can only be called after allocation. | |
| std::byte * | getData () |
| Access to the underlying raw byte buffer. | |
| const std::byte * | getData () const |
A general vertex buffer for storing various indexed attributes.
| ph::IndexedVertexBuffer::IndexedVertexBuffer | ( | ) |
| void ph::IndexedVertexBuffer::allocate | ( | std::size_t | numVertices | ) |
| void ph::IndexedVertexBuffer::declareAttribute | ( | EVertexAttribute | attribute, |
| EVertexElement | element, | ||
| std::size_t | numElements, | ||
| bool | shouldNormalize = false ) |
Declares a vertex attribute with default layout (AoS).
| void ph::IndexedVertexBuffer::declareAttribute | ( | EVertexAttribute | attribute, |
| EVertexElement | element, | ||
| std::size_t | numElements, | ||
| std::size_t | strideOffset, | ||
| std::size_t | strideSize, | ||
| bool | shouldNormalize = false ) |
Declares a vertex attribute with custom layout.
| attribute | Primary type of the vertex attribute. |
| element | Type of the datum that comprise a single attribute. |
| numElements | Number of the data that comprise a single attribute. |
| strideOffset | Offset in the allocated buffer that points to the beginning of the attribute. |
| strideSize | The amount of offset to reach the next attribute. |
| shouldNormalize | Whether to map the stored value to [-1, 1]/[0, 1] depending on element. |
| math::Vector3R ph::IndexedVertexBuffer::getAttribute | ( | EVertexAttribute | attribute, |
| std::size_t | index ) const |
| auto ph::IndexedVertexBuffer::getAttributeDeclaration | ( | EVertexAttribute | attribute | ) | const |
Get information for a previously declared attribute. Can only be called after allocation.
|
inline |
Access to the underlying raw byte buffer.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void ph::IndexedVertexBuffer::setAttribute | ( | EVertexAttribute | attribute, |
| std::size_t | index, | ||
| const math::Vector3R & | value ) |
|
inline |
| void ph::IndexedVertexBuffer::setVertices | ( | const std::byte * | srcBytes, |
| std::size_t | numBytes, | ||
| std::size_t | dstOffset = 0 ) |