All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::VertexDescription Class Reference

This class provides a description of vertex data format used during rendering. More...

#include <Luminous/VertexDescription.hpp>

Public Member Functions

template<typename AttrType >
void addAttribute (const QString &attrName)
 Add an attribute at the end of the description. More...
 
template<typename AttrType >
void addAttribute (const QString &attrName, uint offset)
 Add an attribute at specific offset. More...
 
LUMINOUS_API VertexAttribute attribute (size_t index) const
 Returns the requested attribute. More...
 
LUMINOUS_API size_t attributeCount () const
 Returns the number of attributes in this description. More...
 
LUMINOUS_API const
VertexAttribute
findAttribute (const QString &attrName) const
 Find a named attribute. More...
 
LUMINOUS_API void removeAttribute (const QString &attrName)
 Remove a named attribute. More...
 
LUMINOUS_API VertexDescription ()
 Construct an empty description.
 
LUMINOUS_API uint vertexSize () const
 Returns the total size of a vertex. More...
 

Detailed Description

This class provides a description of vertex data format used during rendering.

Vertex description maps the named vertex components (vertex attributes) used in shaders to data contained in vertex buffers.

Examples:
AdvancedRenderingExample.cpp, PostProcessingExample.cpp, and Widget3DExample.cpp.

Member Function Documentation

template<typename AttrType >
void Luminous::VertexDescription::addAttribute ( const QString &  attrName)

Add an attribute at the end of the description.

Parameters
attrNameVertex attribute name
Template Parameters
AttrTypeType of the vertex attribute
Examples:
AdvancedRenderingExample.cpp, PostProcessingExample.cpp, and Widget3DExample.cpp.
template<typename AttrType >
void Luminous::VertexDescription::addAttribute ( const QString &  attrName,
uint  offset 
)

Add an attribute at specific offset.

Parameters
attrNameVertex attribute name
offsetOffset in bytes from the start of the vertex
Template Parameters
AttrTypeType of the vertex attribute
LUMINOUS_API VertexAttribute Luminous::VertexDescription::attribute ( size_t  index) const

Returns the requested attribute.

Parameters
indexindex of the vertex attribute
Returns
copy of the requested vertex attribute
LUMINOUS_API size_t Luminous::VertexDescription::attributeCount ( ) const

Returns the number of attributes in this description.

Returns
number of attributes
LUMINOUS_API const VertexAttribute* Luminous::VertexDescription::findAttribute ( const QString &  attrName) const

Find a named attribute.

Parameters
attrNameVertex attribute name
Returns
vertex Attribute if the attribute is found; otherwise nullptr
LUMINOUS_API void Luminous::VertexDescription::removeAttribute ( const QString &  attrName)

Remove a named attribute.

Parameters
attrNameVertex attribute name to be removed
LUMINOUS_API uint Luminous::VertexDescription::vertexSize ( ) const

Returns the total size of a vertex.

Returns
vertex size in bytes