OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::VertexElement Class Reference

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

#include <OgreHardwareVertexBuffer.h>

+ Inheritance diagram for Ogre::VertexElement:
+ Collaboration diagram for Ogre::VertexElement:

Public Member Functions

 VertexElement ()
 Constructor, should not be called directly, only needed because of list. More...
 
 VertexElement (unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
 Constructor, should not be called directly, call VertexDeclaration::addElement. More...
 
void baseVertexPointerToElement (void *pBase, void **pElem) const
 Adjusts a pointer to the base of a vertex to point at this element. More...
 
void baseVertexPointerToElement (void *pBase, float **pElem) const
 Adjusts a pointer to the base of a vertex to point at this element. More...
 
void baseVertexPointerToElement (void *pBase, RGBA **pElem) const
 Adjusts a pointer to the base of a vertex to point at this element. More...
 
void baseVertexPointerToElement (void *pBase, unsigned char **pElem) const
 Adjusts a pointer to the base of a vertex to point at this element. More...
 
void baseVertexPointerToElement (void *pBase, unsigned short **pElem) const
 Adjusts a pointer to the base of a vertex to point at this element. More...
 
unsigned short getIndex (void) const
 Gets the index of this element, only applicable for repeating elements. More...
 
size_t getOffset (void) const
 Gets the offset into the buffer where this element starts. More...
 
VertexElementSemantic getSemantic (void) const
 Gets the meaning of this element. More...
 
size_t getSize (void) const
 Gets the size of this element in bytes. More...
 
unsigned short getSource (void) const
 Gets the vertex buffer index from where this element draws it's values. More...
 
VertexElementType getType (void) const
 Gets the data format of this element. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 
bool operator== (const VertexElement &rhs) const
 

Static Public Member Functions

static void convertColourValue (VertexElementType srcType, VertexElementType dstType, uint32 *ptr)
 Utility method for converting colour from one packed 32-bit colour type to another. More...
 
static uint32 convertColourValue (const ColourValue &src, VertexElementType dst)
 Utility method for converting colour to a packed 32-bit colour type. More...
 
static VertexElementType getBaseType (VertexElementType multiType)
 Simple converter function which will a type into it's single-value equivalent - makes switches on type easier. More...
 
static VertexElementType getBestColourVertexElementType (void)
 Utility method to get the most appropriate packed colour vertex element format. More...
 
static unsigned short getTypeCount (VertexElementType etype)
 Utility method which returns the count of values in a given type. More...
 
static size_t getTypeSize (VertexElementType etype)
 Utility method for helping to calculate offsets. More...
 
static VertexElementType multiplyTypeCount (VertexElementType baseType, unsigned short count)
 Simple converter function which will turn a single-value type into a multi-value type based on a parameter. More...
 

Protected Attributes

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

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.

Definition at line 167 of file OgreHardwareVertexBuffer.h.

Constructor & Destructor Documentation

Ogre::VertexElement::VertexElement ( )
inline

Constructor, should not be called directly, only needed because of list.

Definition at line 182 of file OgreHardwareVertexBuffer.h.

Ogre::VertexElement::VertexElement ( unsigned short  source,
size_t  offset,
VertexElementType  theType,
VertexElementSemantic  semantic,
unsigned short  index = 0 
)

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

Member Function Documentation

void Ogre::VertexElement::baseVertexPointerToElement ( void *  pBase,
void **  pElem 
) const
inline

Adjusts a pointer to the base of a vertex to point at this element.

Remarks
This variant is for void pointers, passed as a parameter because we can't rely on covariant return types.
Parameters
pBasePointer to the start of a vertex in this buffer.
pElemPointer to a pointer which will be set to the start of this element.

Definition at line 250 of file OgreHardwareVertexBuffer.h.

void Ogre::VertexElement::baseVertexPointerToElement ( void *  pBase,
float **  pElem 
) const
inline

Adjusts a pointer to the base of a vertex to point at this element.

Remarks
This variant is for float pointers, passed as a parameter because we can't rely on covariant return types.
Parameters
pBasePointer to the start of a vertex in this buffer.
pElemPointer to a pointer which will be set to the start of this element.

Definition at line 264 of file OgreHardwareVertexBuffer.h.

void Ogre::VertexElement::baseVertexPointerToElement ( void *  pBase,
RGBA **  pElem 
) const
inline

Adjusts a pointer to the base of a vertex to point at this element.

Remarks
This variant is for RGBA pointers, passed as a parameter because we can't rely on covariant return types.
Parameters
pBasePointer to the start of a vertex in this buffer.
pElemPointer to a pointer which will be set to the start of this element.

Definition at line 281 of file OgreHardwareVertexBuffer.h.

void Ogre::VertexElement::baseVertexPointerToElement ( void *  pBase,
unsigned char **  pElem 
) const
inline

Adjusts a pointer to the base of a vertex to point at this element.

Remarks
This variant is for char pointers, passed as a parameter because we can't rely on covariant return types.
Parameters
pBasePointer to the start of a vertex in this buffer.
pElemPointer to a pointer which will be set to the start of this element.

Definition at line 294 of file OgreHardwareVertexBuffer.h.

void Ogre::VertexElement::baseVertexPointerToElement ( void *  pBase,
unsigned short **  pElem 
) const
inline

Adjusts a pointer to the base of a vertex to point at this element.

Remarks
This variant is for ushort pointers, passed as a parameter because we can't rely on covariant return types.
Parameters
pBasePointer to the start of a vertex in this buffer.
pElemPointer to a pointer which will be set to the start of this element.

Definition at line 306 of file OgreHardwareVertexBuffer.h.

static void Ogre::VertexElement::convertColourValue ( VertexElementType  srcType,
VertexElementType  dstType,
uint32 ptr 
)
static

Utility method for converting colour from one packed 32-bit colour type to another.

Parameters
srcTypeThe source type
dstTypeThe destination type
ptrRead / write value to change
static uint32 Ogre::VertexElement::convertColourValue ( const ColourValue src,
VertexElementType  dst 
)
static

Utility method for converting colour to a packed 32-bit colour type.

Parameters
srcsource colour
dstThe destination type
static VertexElementType Ogre::VertexElement::getBaseType ( VertexElementType  multiType)
static

Simple converter function which will a type into it's single-value equivalent - makes switches on type easier.

static VertexElementType Ogre::VertexElement::getBestColourVertexElementType ( void  )
static

Utility method to get the most appropriate packed colour vertex element format.

unsigned short Ogre::VertexElement::getIndex ( void  ) const
inline

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

Definition at line 195 of file OgreHardwareVertexBuffer.h.

size_t Ogre::VertexElement::getOffset ( void  ) const
inline

Gets the offset into the buffer where this element starts.

Definition at line 189 of file OgreHardwareVertexBuffer.h.

VertexElementSemantic Ogre::VertexElement::getSemantic ( void  ) const
inline

Gets the meaning of this element.

Definition at line 193 of file OgreHardwareVertexBuffer.h.

size_t Ogre::VertexElement::getSize ( void  ) const

Gets the size of this element in bytes.

unsigned short Ogre::VertexElement::getSource ( void  ) const
inline

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

Definition at line 187 of file OgreHardwareVertexBuffer.h.

VertexElementType Ogre::VertexElement::getType ( void  ) const
inline

Gets the data format of this element.

Definition at line 191 of file OgreHardwareVertexBuffer.h.

static unsigned short Ogre::VertexElement::getTypeCount ( VertexElementType  etype)
static

Utility method which returns the count of values in a given type.

static size_t Ogre::VertexElement::getTypeSize ( VertexElementType  etype)
static

Utility method for helping to calculate offsets.

static VertexElementType Ogre::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.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

bool Ogre::VertexElement::operator== ( const VertexElement rhs) const
inline

Definition at line 231 of file OgreHardwareVertexBuffer.h.

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

Member Data Documentation

unsigned short Ogre::VertexElement::mIndex
protected

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

Definition at line 179 of file OgreHardwareVertexBuffer.h.

Referenced by operator==().

size_t Ogre::VertexElement::mOffset
protected

The offset in the buffer that this element starts at.

Definition at line 173 of file OgreHardwareVertexBuffer.h.

Referenced by operator==().

VertexElementSemantic Ogre::VertexElement::mSemantic
protected

The meaning of the element.

Definition at line 177 of file OgreHardwareVertexBuffer.h.

Referenced by operator==().

unsigned short Ogre::VertexElement::mSource
protected

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

Definition at line 171 of file OgreHardwareVertexBuffer.h.

Referenced by operator==().

VertexElementType Ogre::VertexElement::mType
protected

The type of element.

Definition at line 175 of file OgreHardwareVertexBuffer.h.

Referenced by operator==().


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