![]() |
Raven Engine v0.1
|
Describes a single element in a vertex buffer layout. More...
#include <Buffer.h>
Public Member Functions | |
| BufferElement ()=default | |
| BufferElement (ShaderDataType type, std::string name, bool normalized=false) | |
| Constructs a BufferElement with type, name, and optional normalization. | |
| u32 | GetComponentCount () const |
| Returns the number of components in the element's type. | |
Public Attributes | |
| std::string | Name |
| Name of the element (e.g., "position"). | |
| ShaderDataType | Type |
| Data type of the element. | |
| u32 | Size {} |
| Size in bytes of the element. | |
| usize | Offset {} |
| Byte offset from start of vertex. | |
| bool | Normalized {} |
| Whether the data should be normalized. | |
Describes a single element in a vertex buffer layout.
Contains the element's name, type, size, offset within the buffer, and normalization flag.
The size is automatically computed from the ShaderDataType. The offset is computed when the layout calculates the buffer stride.
|
default |
|
inline |
Constructs a BufferElement with type, name, and optional normalization.
The size is determined by the ShaderDataTypeSize function.
|
inlinenodiscard |
Returns the number of components in the element's type.
For example, Float3 has 3 components, Mat4 has 4. Used for setting up vertex attributes in rendering APIs.
Logs an error and returns 0 if the type is unknown.
| std::string Raven::BufferElement::Name |
Name of the element (e.g., "position").
| bool Raven::BufferElement::Normalized {} |
Whether the data should be normalized.
| usize Raven::BufferElement::Offset {} |
Byte offset from start of vertex.
| u32 Raven::BufferElement::Size {} |
Size in bytes of the element.
| ShaderDataType Raven::BufferElement::Type |
Data type of the element.