overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Classes | Public Types | Public Member Functions | Static Public Member Functions
gameplay::VertexFormat Class Reference

#include <VertexFormat.h>

List of all members.

Classes

class  Element

Public Types

enum  Usage {
  POSITION = 1, NORMAL = 2, COLOR = 3, TANGENT = 4,
  BINORMAL = 5, BLENDWEIGHTS = 6, BLENDINDICES = 7, TEXCOORD0 = 8,
  TEXCOORD1 = 9, TEXCOORD2 = 10, TEXCOORD3 = 11, TEXCOORD4 = 12,
  TEXCOORD5 = 13, TEXCOORD6 = 14, TEXCOORD7 = 15
}

Public Member Functions

 VertexFormat (const Element *elements, unsigned int elementCount)
 ~VertexFormat ()
const ElementgetElement (unsigned int index) const
unsigned int getElementCount () const
unsigned int getVertexSize () const
bool operator== (const VertexFormat &f) const
bool operator!= (const VertexFormat &f) const

Static Public Member Functions

static const char * toString (Usage usage)

Detailed Description

Defines the format of a vertex layout used by a mesh.

A VertexFormat is immutable and cannot be changed once created.


Member Enumeration Documentation

Defines a set of usages for vertex elements.


Constructor & Destructor Documentation

gameplay::VertexFormat::VertexFormat ( const Element elements,
unsigned int  elementCount 
)

Constructor.

The passed in element array is copied into the new VertexFormat.

Parameters:
elementsThe list of vertex elements defining the vertex format.
elementCountThe number of items in the elements array.

Destructor.


Member Function Documentation

const Element& gameplay::VertexFormat::getElement ( unsigned int  index) const

Gets the vertex element at the specified index.

Parameters:
indexThe index of the element to retrieve.

Gets the number of elements in this VertexFormat.

Returns:
The number of items in the elements array.
unsigned int gameplay::VertexFormat::getVertexSize ( ) const

Gets the size (in bytes) of a single vertex using this format.

bool gameplay::VertexFormat::operator!= ( const VertexFormat f) const

Compares to vertex formats for inequality.

Parameters:
fThe vertex format to compare.
Returns:
true if the elements in this VertexFormat are not equal to the specified one, false otherwise.
bool gameplay::VertexFormat::operator== ( const VertexFormat f) const

Compares two vertex formats for equality.

Parameters:
fThe vertex format to compare.
Returns:
true if the elements in this VertexFormat matches the specified one, false otherwise.
static const char* gameplay::VertexFormat::toString ( Usage  usage) [static]

Returns a string representation of a Usage enumeration value.

 All Classes Functions Variables Typedefs Enumerations Enumerator