Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Static Public Member Functions | Protected Attributes
render::VertexElement Class Reference

#include <VertexBuffer.h>

List of all members.

Public Member Functions

u16 getIndex () const
 Gets the index of this element, only applicable for repeating elements.
u32 getOffset () const
 Gets the offset into the buffer where this element starts.
VertexElementSemantic getSemantic () const
 Gets the meaning of this element.
u32 getSize () const
 Gets the size of this element in bytes.
u16 getSource () const
 Gets the vertex buffer index from where this element draws it's values.
VertexElementType getType () const
 Gets the data format of this element.
bool operator== (const VertexElement &rhs) const
 VertexElement (u16 source, u32 offset, VertexElementType theType, VertexElementSemantic semantic, u16 index=0)
 Constructor, should not be called directly, call VertexDeclaration::addElement.

Static Public Member Functions

static u16 getTypeCount (VertexElementType etype)
 Utility method which returns the count of values in a given type.
static u32 getTypeSize (VertexElementType etype)
 Utility method for helping to calculate offsets.
static VertexElementType multiplyTypeCount (VertexElementType baseType, unsigned short count)

Protected Attributes

u16 mIndex
 Index of the item, only applicable for some elements like texture coords.
u32 mOffset
 The offset in the buffer that this element starts at.
VertexElementSemantic mSemantic
 The meaning of the element.
u16 mSource
 The source vertex buffer, as bound to an index using VertexBufferBinding.
VertexElementType mType
 The type of element.

Detailed Description

This class declares the usage of a single vertex buffer as a component of a complete VertexDeclaration.

Remarks:
Several vertex buffers can be used to supply the input geometry for a rendering operation, and in each case a vertex buffer can be used in different ways for different operations; the buffer itself does not define the semantics (position, normal etc), the VertexElement class does.

Constructor & Destructor Documentation

render::VertexElement::VertexElement ( u16  source,
u32  offset,
VertexElementType  theType,
VertexElementSemantic  semantic,
u16  index = 0 
)

Constructor, should not be called directly, call VertexDeclaration::addElement.

References mIndex, mOffset, mSemantic, mSource, and mType.


Member Function Documentation

u16 render::VertexElement::getIndex ( ) const

Gets the index of this element, only applicable for repeating elements.

References mIndex.

u32 render::VertexElement::getOffset ( ) const

Gets the offset into the buffer where this element starts.

References mOffset.

VertexElementSemantic render::VertexElement::getSemantic ( ) const

Gets the meaning of this element.

References mSemantic.

u32 render::VertexElement::getSize ( ) const

Gets the size of this element in bytes.

References getTypeSize(), and mType.

u16 render::VertexElement::getSource ( ) const

Gets the vertex buffer index from where this element draws it's values.

References mSource.

VertexElementType render::VertexElement::getType ( ) const

Gets the data format of this element.

References mType.

u16 render::VertexElement::getTypeCount ( VertexElementType  etype) [static]
u32 render::VertexElement::getTypeSize ( VertexElementType  etype) [static]
VertexElementType render::VertexElement::multiplyTypeCount ( VertexElementType  baseType,
unsigned short  count 
) [static]

Simple converter function which will turn a single-value type into a multi-value type based on a parameter.

References render::VET_FLOAT1, render::VET_FLOAT2, render::VET_FLOAT3, render::VET_FLOAT4, render::VET_SHORT1, render::VET_SHORT2, render::VET_SHORT3, and render::VET_SHORT4.

bool render::VertexElement::operator== ( const VertexElement rhs) const [inline]

References mIndex, mOffset, mSemantic, mSource, and mType.


Member Data Documentation

Index of the item, only applicable for some elements like texture coords.

Referenced by getIndex(), operator==(), and VertexElement().

The offset in the buffer that this element starts at.

Referenced by getOffset(), operator==(), and VertexElement().

The meaning of the element.

Referenced by getSemantic(), operator==(), and VertexElement().

The source vertex buffer, as bound to an index using VertexBufferBinding.

Referenced by getSource(), operator==(), and VertexElement().

The type of element.

Referenced by getSize(), getType(), operator==(), and VertexElement().


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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:09 by Doxygen (1.7.4)