OGRE: Ogre::VertexElement Class Reference

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::VertexElement Class Reference
Core » RenderSystem

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:
[legend]

## 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.
template<typename T>
void | baseVertexPointerToElement (void *pBase, T **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.
bool | operator== (const VertexElement &rhs) const

## Static Public Member Functions
static uint32 | convertColourValue (const ColourValue &src, VertexElementType)
static void | convertColourValue (VertexElementType srcType, VertexElementType dstType, uint32 *ptr)
static VertexElementType | getBaseType (VertexElementType multiType)
| Simple converter function which will turn a type into it's single-value (or lowest multiple-value) equivalent - makes switches on type easier.
static VertexElementType | getBestColourVertexElementType ()
static unsigned short | getTypeCount (VertexElementType etype)
| Utility method which returns the count of values in a given type (result for colors may be counter-intuitive).
static size_t | getTypeSize (VertexElementType etype)
| Utility method for helping to calculate offsets.
static VertexElementType | multiplyTypeCount (VertexElementType baseType, unsigned short count)
| Simple converter function which will return a type large enough to hold 'count' values of the same type as the values in 'baseType'.

## Detailed Description

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

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::VertexElement::VertexElement | ( |  | ) |
| inline

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

Referenced by operator==().

## ◆ VertexElement() [2/2]

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

## ◆ getSource()

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

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

## ◆ getOffset()

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

Gets the offset into the buffer where this element starts.

## ◆ getType()

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

Gets the data format of this element.

## ◆ getSemantic()

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

Gets the meaning of this element.

## ◆ getIndex()

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

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

## ◆ getSize()

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

Gets the size of this element in bytes.

## ◆ getTypeSize()

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

Utility method for helping to calculate offsets.

## ◆ getTypeCount()

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

Utility method which returns the count of values in a given type (result for colors may be counter-intuitive).

## ◆ multiplyTypeCount()

VertexElementType Ogre::VertexElement::multiplyTypeCount | ( | VertexElementType | baseType,
|  | unsigned short | count )
| static

Simple converter function which will return a type large enough to hold 'count' values of the same type as the values in 'baseType'.

The 'baseType' parameter should have the smallest count available. The return type may have the count rounded up to the next multiple of 4 bytes. Byte types will always return a 4-count type, while short types will return either a 2-count or 4-count type.

## ◆ getBaseType()

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

Simple converter function which will turn a type into it's single-value (or lowest multiple-value) equivalent - makes switches on type easier.

May give counter-intuitive results with bytes or shorts.

## ◆ convertColourValue() [1/2]

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

Deprecated
  do not use

## ◆ convertColourValue() [2/2]

uint32 Ogre::VertexElement::convertColourValue | ( | const ColourValue & | src,
|  | VertexElementType | )
| inlinestatic

Deprecated
  use ColourValue::getAsABGR()

References Ogre::ColourValue::getAsABGR().

## ◆ getBestColourVertexElementType()

VertexElementType Ogre::VertexElement::getBestColourVertexElementType | ( |  | ) |
| inlinestatic

Deprecated
  use VET_UBYTE4_NORM

References Ogre::VET_UBYTE4_NORM.

## ◆ operator==()

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

References VertexElement().

## ◆ baseVertexPointerToElement()

template<typename T>

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

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

Pointers are passed as a parameter because we can't rely on covariant return types.

Parameters

  pBase | Pointer to the start of a vertex in this buffer.
  pElem | Pointer to a pointer which will be set to the start of this element.

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

- OgreHardwareVertexBuffer.h