KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::BufferElement Struct Reference

A datastructure for creating interleaved data for Mesh with a specifc format (BufferLayout) More...

#include <Buffer.h>

Public Member Functions

 BufferElement (ShaderDataType type, const std::string &name, bool normalized=false, uint64_t offset=0)
 A constructor.
 
uint32_t GetComponentCount () const
 Routine to compute number of components of this element.
 

Public Attributes

std::string Name
 A name for vertex data, created by interleaving of various attributes.
 
uint64_t Offset
 The location (offset) of this element in the vertex or index data set.
 
uint32_t Size
 The size of this element.
 
ShaderDataType Type
 The type of the attribute.
 
bool Normalized
 

Detailed Description

A datastructure for creating interleaved data for Mesh with a specifc format (BufferLayout)

Constructor & Destructor Documentation

◆ BufferElement()

Karma::BufferElement::BufferElement ( ShaderDataType type,
const std::string & name,
bool normalized = false,
uint64_t offset = 0 )
inline

A constructor.

Parameters
typeOne of the defined ShaderDataType
namename of the attribute (MeshAttribute)
normalizedFor glVertexAttribPointer, if normalized is set to true, it indicates that values stored in an integer format are to be mapped to the range [-1,1] (for signed values) or [0,1] (for unsigned values) when they are accessed and converted to floating point. Otherwise, values will be converted to floats directly without normalization
offsetThe amount of gap to be left, for instance in vertexarray
Todo
Think about vulkan needs of normalized parameter, with opengl in context, and try to abstract accordingly. Also may need to think about the custom default offsets
Since
Karma 1.0.0

Member Function Documentation

◆ GetComponentCount()

uint32_t Karma::BufferElement::GetComponentCount ( ) const
inline

Routine to compute number of components of this element.

Since
Karma 1.0.0

Member Data Documentation

◆ Name

std::string Karma::BufferElement::Name

A name for vertex data, created by interleaving of various attributes.

See also
MeshAttribute
Since
Karma 1.0.0

◆ Offset

uint64_t Karma::BufferElement::Offset

The location (offset) of this element in the vertex or index data set.

See also
CalculateOffsetsAndStride()
Since
Karma 1.0.0

◆ Size

uint32_t Karma::BufferElement::Size

The size of this element.

See also
ShaderDataTypeSize
CalculateOffsetsAndBufferSize
Since
Karma 1.0.0

◆ Type

ShaderDataType Karma::BufferElement::Type

The type of the attribute.

Since
Karma 1.0.0

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