Unofficial OpenGL Software Development Kit  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members | Public Member Functions
glmesh::AttribDesc Class Reference

#include <VertexFormat.h>

Describes the storage for a single vertex attribute.

This object is used as part of the construction for a VertexFormat. It allows for "atomic" construction of VertexFormat objects, such that all attributes are added at once during construction.

Note
A valid OpenGL context must be active to create one of these objects. Do not make global variables of these.

Public Member Functions

 AttribDesc (unsigned int attribIndex, unsigned int numComponents, VertexDataType vertType, AttribDataType attribType)
 Creates a valid AttribDesc. More...
 
unsigned int GetAttribIndex () const
 Get the attribute index to be passed to glVertexAttribPointer for this attribute.
 
unsigned int GetNumComponents () const
 Get the number of components in the attribute's data.
 
VertexDataType GetVertexDataType () const
 Get the C/C++ type of the attribute data.
 
AttribDataType GetAttribDataType () const
 Get the interpretation of that attribute's type.
 
size_t ByteSize () const
 Computes the size in bytes of this attribute.
 

Constructor & Destructor Documentation

glmesh::AttribDesc::AttribDesc ( unsigned int  attribIndex,
unsigned int  numComponents,
VertexDataType  vertType,
AttribDataType  attribType 
)

Creates a valid AttribDesc.

Exceptions
AttributeDataUnsupportedExceptionIf attribIndex is outside the implementation-defined allowed range of OpenGL attributes.
AttributeDataInvalidExceptionIf vertType and attribType do not match, as defined in glmesh::AttribDataType.
AttributeDataInvalidExceptionIf numComponents is not on the range [1, 4].
AttributeDataUnsupportedExceptionIf attribType is ADT_DOUBLE and the implementation doesn't support double-precision attributes.
AttributeDataUnsupportedExceptionIf attribType is ADT_INTEGER and the implementation doesn't support integral attributes.
AttributeDataUnsupportedExceptionIf vertType is VDT_HALF_FLOAT and the implementation doesn't support half-floating point attributes.

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