OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::v1::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::v1::VertexElement:

Public Member Functions

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

Static Public Member Functions

static uint32 convertColourValue (const ColourValue &src, VertexElementType dst)
 Utility method for converting colour to a packed 32-bit colour type.
 
static void convertColourValue (VertexElementType srcType, VertexElementType dstType, uint32 *ptr)
 Utility method for converting colour from one packed 32-bit colour type to another.
 
static VertexElementType getBaseType (VertexElementType multiType)
 Simple converter function which will a type into it's single-value equivalent - makes switches on type easier.
 
static VertexElementType getBestColourVertexElementType (void)
 Utility method to get the most appropriate packed colour vertex element format.
 
static unsigned short getTypeCount (VertexElementType etype)
 Utility method which returns the count of values in a given type.
 
static size_t getTypeSize (VertexElementType etype)
 Utility method for helping to calculate offsets.
 
static bool isTypeNormalized (VertexElementType etype)
 Utility method which returns true if the type is SNORM or NORM.
 
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.
 

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

◆ VertexElement() [1/2]

Ogre::v1::VertexElement::VertexElement ( )
inline

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

◆ VertexElement() [2/2]

Ogre::v1::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

◆ baseVertexPointerToElement() [1/5]

void Ogre::v1::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.

◆ baseVertexPointerToElement() [2/5]

void Ogre::v1::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.

◆ baseVertexPointerToElement() [3/5]

void Ogre::v1::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.

◆ baseVertexPointerToElement() [4/5]

void Ogre::v1::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.

◆ baseVertexPointerToElement() [5/5]

void Ogre::v1::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.

◆ convertColourValue() [1/2]

static uint32 Ogre::v1::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

◆ convertColourValue() [2/2]

static void Ogre::v1::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

◆ getBaseType()

static VertexElementType Ogre::v1::VertexElement::getBaseType ( VertexElementType  multiType)
static

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

◆ getBestColourVertexElementType()

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

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

◆ getIndex()

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

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

◆ getOffset()

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

Gets the offset into the buffer where this element starts.

◆ getSemantic()

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

Gets the meaning of this element.

◆ getSize()

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

Gets the size of this element in bytes.

◆ getSource()

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

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

◆ getType()

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

Gets the data format of this element.

◆ getTypeCount()

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

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

◆ getTypeSize()

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

Utility method for helping to calculate offsets.

◆ isTypeNormalized()

static bool Ogre::v1::VertexElement::isTypeNormalized ( VertexElementType  etype)
static

Utility method which returns true if the type is SNORM or NORM.

◆ multiplyTypeCount()

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

◆ operator delete() [1/3]

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

◆ operator delete() [2/3]

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

◆ operator delete() [3/3]

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

◆ operator delete[]() [1/2]

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

◆ operator delete[]() [2/2]

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

◆ operator new() [1/3]

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

◆ operator new() [2/3]

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

◆ operator new() [3/3]

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

placement operator new

◆ operator new[]() [1/2]

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

◆ operator new[]() [2/2]

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

◆ operator==()

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

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