Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::render::VertexAttributes Struct Reference

Public Member Functions

template<typename V>
void bindVertexAttributes ()
 Bind vertex array attributes to stored vertex array based on the vertex type.
void enableVertexAttribPointer (const uint32_t index, const size_t offset, const int32_t componentCount)
void enableVertexAttribIPointer (const uint32_t index, const size_t offset, const int32_t componentCount)
template<typename T>
int32_t getComponentSize () noexcept
 Return the number of components in T.
template<typename VertexType, typename T>
void bindVertexAttributeToPointer (const uint32_t index, const size_t offset) noexcept
 Enable and bind a vertex attribute of type T to the location, and fill value from offset in structure VertexType.
template<typename VertexType, typename T>
void bindVertexAttributeToIPointer (const uint32_t index, const size_t offset) noexcept
 Enable and bind a vertex attribute of type T to the location, and fill value from offset in structure VertexType.

Public Attributes

uint32_t & vertex_array

Member Function Documentation

◆ bindVertexAttributes()

template<typename V>
void oe::render::VertexAttributes::bindVertexAttributes ( )

Bind vertex array attributes to stored vertex array based on the vertex type.

Note
You need to overload this method for your custom vertex type
See also
mesh.inl bindings for builtin Vertex as example

◆ bindVertexAttributeToIPointer()

template<typename VertexType, typename T>
void oe::render::VertexAttributes::bindVertexAttributeToIPointer ( const uint32_t index,
const size_t offset )
inlinenoexcept

Enable and bind a vertex attribute of type T to the location, and fill value from offset in structure VertexType.

Parameters
indexindex of the vertex attribute to be modified
offsetOffset to get the component

◆ bindVertexAttributeToPointer()

template<typename VertexType, typename T>
void oe::render::VertexAttributes::bindVertexAttributeToPointer ( const uint32_t index,
const size_t offset )
inlinenoexcept

Enable and bind a vertex attribute of type T to the location, and fill value from offset in structure VertexType.

Parameters
indexindex of the vertex attribute to be modified
offsetOffset to get the component

◆ getComponentSize()

template<typename T>
int32_t oe::render::VertexAttributes::getComponentSize ( )
noexcept

Return the number of components in T.

Exemple: vec3 have 3 elements, so getComponentSize<vec3>() should return 3


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