OGRE-Next
3.0.0
Object-Oriented Graphics Rendering Engine
|
This class declares the format of a set of vertex inputs, which can be issued to the rendering API through a RenderOperation. More...
#include <OgreHardwareVertexBuffer.h>
Public Types | |
typedef list< VertexElement >::type | VertexElementList |
Defines the list of vertex elements that makes up this declaration. More... | |
Public Member Functions | |
VertexDeclaration (HardwareBufferManagerBase *creator) | |
Standard constructor, not you should use HardwareBufferManager::createVertexDeclaration. More... | |
virtual | ~VertexDeclaration () |
uint16 | _getInputLayoutId (HlmsManager *hlmsManager, OperationType opType) |
VertexDeclaration do not store OperationType, which is why we cache just the base 10 bits. More... | |
virtual const VertexElement & | addElement (unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0) |
Adds a new VertexElement to this declaration. More... | |
virtual VertexDeclaration * | clone (HardwareBufferManagerBase *mgr=0) const |
Clones this declaration. More... | |
void | closeGapsInSource () |
Remove any gaps in the source buffer list used by this declaration. More... | |
void | convertFromV2 (const VertexElement2Vec &v2Decl) |
void | convertFromV2 (const VertexElement2VecVec &v2Decl) |
VertexElement2VecVec | convertToV2 () |
virtual const VertexElement * | findElementBySemantic (VertexElementSemantic sem, unsigned short index=0) const |
Finds a VertexElement with the given semantic, and index if there is more than one element with the same semantic. More... | |
virtual VertexElementList | findElementsBySource (unsigned short source) const |
Based on the current elements, gets the size of the vertex for a given buffer source. More... | |
VertexDeclaration * | getAutoOrganisedDeclaration (bool skeletalAnimation, bool vertexAnimation, bool vertexAnimationNormals) const |
Generates a new VertexDeclaration for optimal usage based on the current vertex declaration, which can be used with VertexData::reorganiseBuffers later if you wish, or simply used as a template. More... | |
const VertexElement * | getElement (unsigned short index) const |
Get a single element. More... | |
size_t | getElementCount () const |
Get the number of elements in the declaration. More... | |
const VertexElementList & | getElements () const |
Gets read-only access to the list of vertex elements. More... | |
unsigned short | getMaxSource () const |
Gets the index of the highest source value referenced by this declaration. More... | |
virtual unsigned short | getNextFreeTextureCoordinate () const |
Return the index of the next free texture coordinate set which may be added to this declaration. More... | |
virtual size_t | getVertexSize (unsigned short source) const |
Gets the vertex size defined by this declaration for a given source. More... | |
virtual const VertexElement & | insertElement (unsigned short atPosition, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0) |
Inserts a new VertexElement at a given position in this declaration. More... | |
bool | isSortedForV2 () const |
virtual void | modifyElement (unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0) |
Modify an element in-place, params as addElement. More... | |
bool | operator!= (const VertexDeclaration &rhs) const |
bool | operator== (const VertexDeclaration &rhs) const |
virtual void | removeAllElements () |
Remove all elements. More... | |
virtual void | removeElement (unsigned short elem_index) |
Remove the element at the given index from this declaration. More... | |
virtual void | removeElement (VertexElementSemantic semantic, unsigned short index=0) |
Remove the element with the given semantic and usage index. More... | |
void | sort () |
Sorts the elements in this list to be compatible with the maximum number of rendering APIs / graphics cards. More... | |
void | sortForV2 () |
Static Public Member Functions | |
static bool | vertexElementLess (const VertexElement &e1, const VertexElement &e2) |
Sort routine for vertex elements. More... | |
static bool | vertexElementLessForV2 (const VertexElement &e1, const VertexElement &e2) |
This class declares the format of a set of vertex inputs, which can be issued to the rendering API through a RenderOperation.
typedef list<VertexElement>::type Ogre::v1::VertexDeclaration::VertexElementList |
Defines the list of vertex elements that makes up this declaration.
Ogre::v1::VertexDeclaration::VertexDeclaration | ( | HardwareBufferManagerBase * | creator | ) |
Standard constructor, not you should use HardwareBufferManager::createVertexDeclaration.
|
virtual |
uint16 Ogre::v1::VertexDeclaration::_getInputLayoutId | ( | HlmsManager * | hlmsManager, |
OperationType | opType | ||
) |
VertexDeclaration do not store OperationType, which is why we cache just the base 10 bits.
This function is not const as it will modify mBaseInputLayoutId if the layout is dirty
hlmsManager | |
opType |
|
virtual |
Adds a new VertexElement to this declaration.
source | The binding index of HardwareVertexBuffer which will provide the source for this element. See VertexBufferBinding for full information. |
offset | The offset in bytes where this element is located in the buffer |
theType | The data format of the element (3 floats, a colour etc) |
semantic | The meaning of the data (position, normal, diffuse colour etc) |
index | Optional index for multi-input elements like texture coordinates |
|
virtual |
Clones this declaration.
mgr | Optional HardwareBufferManager to use for creating the clone (if null, use the current default). |
void Ogre::v1::VertexDeclaration::closeGapsInSource | ( | ) |
Remove any gaps in the source buffer list used by this declaration.
void Ogre::v1::VertexDeclaration::convertFromV2 | ( | const VertexElement2Vec & | v2Decl | ) |
void Ogre::v1::VertexDeclaration::convertFromV2 | ( | const VertexElement2VecVec & | v2Decl | ) |
VertexElement2VecVec Ogre::v1::VertexDeclaration::convertToV2 | ( | ) |
|
virtual |
Finds a VertexElement with the given semantic, and index if there is more than one element with the same semantic.
|
virtual |
Based on the current elements, gets the size of the vertex for a given buffer source.
source | The buffer binding index for which to get the vertex size. Gets a list of elements which use a given source. |
VertexDeclaration* Ogre::v1::VertexDeclaration::getAutoOrganisedDeclaration | ( | bool | skeletalAnimation, |
bool | vertexAnimation, | ||
bool | vertexAnimationNormals | ||
) | const |
Generates a new VertexDeclaration for optimal usage based on the current vertex declaration, which can be used with VertexData::reorganiseBuffers later if you wish, or simply used as a template.
skeletalAnimation | Whether this vertex data is going to be skeletally animated |
vertexAnimation | Whether this vertex data is going to be vertex animated |
vertexAnimationNormals | Whether vertex data animation is going to include normals animation |
const VertexElement* Ogre::v1::VertexDeclaration::getElement | ( | unsigned short | index | ) | const |
Get a single element.
|
inline |
Get the number of elements in the declaration.
const VertexElementList& Ogre::v1::VertexDeclaration::getElements | ( | ) | const |
Gets read-only access to the list of vertex elements.
unsigned short Ogre::v1::VertexDeclaration::getMaxSource | ( | ) | const |
Gets the index of the highest source value referenced by this declaration.
|
virtual |
Return the index of the next free texture coordinate set which may be added to this declaration.
|
virtual |
Gets the vertex size defined by this declaration for a given source.
|
virtual |
Inserts a new VertexElement at a given position in this declaration.
source | The binding index of HardwareVertexBuffer which will provide the source for this element. See VertexBufferBinding for full information. |
offset | The offset in bytes where this element is located in the buffer |
theType | The data format of the element (3 floats, a colour etc) |
semantic | The meaning of the data (position, normal, diffuse colour etc) |
index | Optional index for multi-input elements like texture coordinates |
bool Ogre::v1::VertexDeclaration::isSortedForV2 | ( | ) | const |
|
virtual |
Modify an element in-place, params as addElement.
|
inline |
|
inline |
|
virtual |
Remove all elements.
|
virtual |
Remove the element at the given index from this declaration.
|
virtual |
Remove the element with the given semantic and usage index.
void Ogre::v1::VertexDeclaration::sort | ( | ) |
Sorts the elements in this list to be compatible with the maximum number of rendering APIs / graphics cards.
void Ogre::v1::VertexDeclaration::sortForV2 | ( | ) |
|
static |
Sort routine for vertex elements.
|
static |