LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::VertexFormat Struct Reference

Utility structure to store vertex attributes. More...

#include <VertexFormat.h>

Public Member Functions

void AppendAttribute (const VertexAttribute &attrib)
 Appends the specified vertex attribute to this vertex format.
std::uint32_t GetStride () const
 Returns the stride (in bytes) of the first vertex.
std::uint32_t GetStride (std::uint32_t slot) const
 Returns the stride (in bytes) of the first vertex with the specified buffer binding slot.
void SetStride (std::uint32_t stride)
 Set the stride member for all vertex attributes to the specified value.
void SetStride (std::uint32_t stride, std::uint32_t slot)
 Set the stride member for all vertex attributes with the specified buffer binding slot to the new value specified by stride.
void SetSlot (std::uint32_t slot)
 Sets the slot member for all vertex attributes to the specified value.

Public Attributes

std::vector< VertexAttribute > attributes
 Specifies the list of vertex attributes.

Detailed Description

Utility structure to store vertex attributes.

Remarks
A vertex format is required to describe how the vertex attributes are laid out inside a vertex buffer.
See also
BufferDescriptor::VertexBuffer::format

Member Function Documentation

◆ AppendAttribute()

void LLGL::VertexFormat::AppendAttribute ( const VertexAttribute & attrib)
inline

Appends the specified vertex attribute to this vertex format.

Parameters
[in]attribSpecifies the new attribute which is appended to this vertex format.
Remarks
This function modifies the offset member of specified attribute before adding it to the attributes list, and sets the stride member to the sum of the size of all attributes.
See also
VertexAttribute::offset

◆ GetStride() [1/2]

std::uint32_t LLGL::VertexFormat::GetStride ( ) const
inline

Returns the stride (in bytes) of the first vertex.

Remarks
It is expected that all vertices with the same buffer binding slot have the same stride.
See also
VertexAttribute::GetSize

◆ GetStride() [2/2]

std::uint32_t LLGL::VertexFormat::GetStride ( std::uint32_t slot) const
inline

Returns the stride (in bytes) of the first vertex with the specified buffer binding slot.

Remarks
It is expected that all vertices with the same buffer binding slot have the same stride.
See also
VertexAttribute::GetSize

◆ SetSlot()

void LLGL::VertexFormat::SetSlot ( std::uint32_t slot)
inline

Sets the slot member for all vertex attributes to the specified value.

See also
VertexAttribute::slot

◆ SetStride() [1/2]

void LLGL::VertexFormat::SetStride ( std::uint32_t stride)
inline

Set the stride member for all vertex attributes to the specified value.

See also
VertexAttribute::stride

◆ SetStride() [2/2]

void LLGL::VertexFormat::SetStride ( std::uint32_t stride,
std::uint32_t slot )
inline

Set the stride member for all vertex attributes with the specified buffer binding slot to the new value specified by stride.

See also
VertexAttribute::stride

Member Data Documentation

◆ attributes

std::vector<VertexAttribute> LLGL::VertexFormat::attributes

Specifies the list of vertex attributes.

See also
AppendAttribute

The documentation for this struct was generated from the following file: