DigitalSpaces::DIOGREVertexDeclaration Struct Reference
[Ogre]

#include <OGREInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.


Public Member Functions

unsigned long GetElementCount (void)
 Get the number of elements in the declaration.
DIOGREVertexElementGetElement (unsigned short index)
 Gets read-only access to the list of vertex elements.
void Sort (void)
 Sorts the elements in this list to be compatible with the maximum number of rendering APIs / graphics cards.
void CloseGapsInSource (void)
 Remove any gaps in the source buffer list used by this declaration.
DIOGREVertexDeclarationGetAutoOrganisedDeclaration (bool skeletalAnimation, bool vertexAnimation)
 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.
unsigned short GetMaxSource (void)
 Gets the indeex of the highest source value referenced by this declaration.
DIOGREVertexElementAddElement (unsigned short source, unsigned long offset, OGREVertexElementType theType, OGREVertexElementSemantic semantic)
 Adds a new VertexElement to this declaration.
DIOGREVertexElementAddElement (unsigned short source, unsigned long offset, OGREVertexElementType theType, OGREVertexElementSemantic semantic, unsigned short index)
DIOGREVertexElementInsertElement (unsigned short atPosition, unsigned short source, unsigned long offset, OGREVertexElementType theType, OGREVertexElementSemantic semantic)
 Inserts a new VertexElement at a given position in this declaration.
DIOGREVertexElementInsertElement (unsigned short atPosition, unsigned short source, unsigned long offset, OGREVertexElementType theType, OGREVertexElementSemantic semantic, unsigned short index)
void RemoveElement (unsigned short elem_index)
 Remove the element at the given index from this declaration.
void RemoveElement (OGREVertexElementSemantic semantic)
 Remove the element with the given semantic and usage index.
void RemoveElement (OGREVertexElementSemantic semantic, unsigned short index)
void ModifyElement (unsigned short elem_index, unsigned short source, unsigned long offset, OGREVertexElementType theType, OGREVertexElementSemantic semantic)
 Modify an element in-place, params as addElement.
void ModifyElement (unsigned short elem_index, unsigned short source, unsigned long offset, OGREVertexElementType theType, OGREVertexElementSemantic semantic, unsigned short index)
DIOGREVertexElementFindElementBySemantic (OGREVertexElementSemantic sem)
 Finds a VertexElement with the given semantic, and index if there is more than one element with the same semantic.
DIOGREVertexElementFindElementBySemantic (OGREVertexElementSemantic sem, unsigned short index)
unsigned long GetVertexSize (unsigned short source)
 Based on the current elements, gets the size of the vertex for a given buffer source.
DIOGREVertexDeclarationClone (void)
 Clones this declaration.

Member Function Documentation

unsigned long DigitalSpaces::DIOGREVertexDeclaration::GetElementCount ( void   ) 

Get the number of elements in the declaration.

DIOGREVertexElement* DigitalSpaces::DIOGREVertexDeclaration::GetElement ( unsigned short  index  ) 

Gets read-only access to the list of vertex elements.

Get a single element.

void DigitalSpaces::DIOGREVertexDeclaration::Sort ( void   ) 

Sorts the elements in this list to be compatible with the maximum number of rendering APIs / graphics cards.

Remarks:
Older graphics cards require vertex data to be presented in a more rigid way, as defined in the main documentation for this class. As well as the ordering being important, where shared source buffers are used, the declaration must list all the elements for each source in turn.

void DigitalSpaces::DIOGREVertexDeclaration::CloseGapsInSource ( void   ) 

Remove any gaps in the source buffer list used by this declaration.

Remarks:
This is useful if you've modified a declaration and want to remove any gaps in the list of buffers being used. Note, however, that if this declaration is already being used with a VertexBufferBinding, you will need to alter that too. This method is mainly useful when reorganising buffers based on an altered declaration.
Note:
This will cause the vertex declaration to be re-sorted.

DIOGREVertexDeclaration* DigitalSpaces::DIOGREVertexDeclaration::GetAutoOrganisedDeclaration ( bool  skeletalAnimation,
bool  vertexAnimation 
)

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.

Parameters:
animated Whether this vertex data is going to be animated; this affects the choice of both usage and buffer splits.

unsigned short DigitalSpaces::DIOGREVertexDeclaration::GetMaxSource ( void   ) 

Gets the indeex of the highest source value referenced by this declaration.

DIOGREVertexElement* DigitalSpaces::DIOGREVertexDeclaration::AddElement ( unsigned short  source,
unsigned long  offset,
OGREVertexElementType  theType,
OGREVertexElementSemantic  semantic 
)

Adds a new VertexElement to this declaration.

Remarks:
This method adds a single element (positions, normals etc) to the end of the vertex declaration. Please read the information in VertexDeclaration about the importance of ordering and structure for compatibility with older D3D drivers.
Parameters:
source The binding index of HardwareVertexBuffer which will provide the source for this element. See VertexBufferBindingState 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
Returns:
A reference to the VertexElement added.

DIOGREVertexElement* DigitalSpaces::DIOGREVertexDeclaration::AddElement ( unsigned short  source,
unsigned long  offset,
OGREVertexElementType  theType,
OGREVertexElementSemantic  semantic,
unsigned short  index 
)

DIOGREVertexElement* DigitalSpaces::DIOGREVertexDeclaration::InsertElement ( unsigned short  atPosition,
unsigned short  source,
unsigned long  offset,
OGREVertexElementType  theType,
OGREVertexElementSemantic  semantic 
)

Inserts a new VertexElement at a given position in this declaration.

Remarks:
This method adds a single element (positions, normals etc) at a given position in this vertex declaration. Please read the information in VertexDeclaration about the importance of ordering and structure for compatibility with older D3D drivers.
Parameters:
source The binding index of HardwareVertexBuffer which will provide the source for this element. See VertexBufferBindingState 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
Returns:
A reference to the VertexElement added.

DIOGREVertexElement* DigitalSpaces::DIOGREVertexDeclaration::InsertElement ( unsigned short  atPosition,
unsigned short  source,
unsigned long  offset,
OGREVertexElementType  theType,
OGREVertexElementSemantic  semantic,
unsigned short  index 
)

void DigitalSpaces::DIOGREVertexDeclaration::RemoveElement ( unsigned short  elem_index  ) 

Remove the element at the given index from this declaration.

void DigitalSpaces::DIOGREVertexDeclaration::RemoveElement ( OGREVertexElementSemantic  semantic  ) 

Remove the element with the given semantic and usage index.

Remarks:
In this case 'index' means the usage index for repeating elements such as texture coordinates. For other elements this will always be 0 and does not refer to the index in the vector.

void DigitalSpaces::DIOGREVertexDeclaration::RemoveElement ( OGREVertexElementSemantic  semantic,
unsigned short  index 
)

void DigitalSpaces::DIOGREVertexDeclaration::ModifyElement ( unsigned short  elem_index,
unsigned short  source,
unsigned long  offset,
OGREVertexElementType  theType,
OGREVertexElementSemantic  semantic 
)

Modify an element in-place, params as addElement.

Remarks:
Please read the information in VertexDeclaration about the importance of ordering and structure for compatibility with older D3D drivers.

void DigitalSpaces::DIOGREVertexDeclaration::ModifyElement ( unsigned short  elem_index,
unsigned short  source,
unsigned long  offset,
OGREVertexElementType  theType,
OGREVertexElementSemantic  semantic,
unsigned short  index 
)

DIOGREVertexElement* DigitalSpaces::DIOGREVertexDeclaration::FindElementBySemantic ( OGREVertexElementSemantic  sem  ) 

Finds a VertexElement with the given semantic, and index if there is more than one element with the same semantic.

Remarks:
If the element is not found, this method returns null.

DIOGREVertexElement* DigitalSpaces::DIOGREVertexDeclaration::FindElementBySemantic ( OGREVertexElementSemantic  sem,
unsigned short  index 
)

unsigned long DigitalSpaces::DIOGREVertexDeclaration::GetVertexSize ( unsigned short  source  ) 

Based on the current elements, gets the size of the vertex for a given buffer source.

Parameters:
source The buffer binding index for which to get the vertex size. Gets a list of elements which use a given source.
Remarks:
Note that the list of elements is returned by value therefore is separate from the declaration as soon as this method returns. Gets the vertex size defined by this declaration for a given source.

DIOGREVertexDeclaration* DigitalSpaces::DIOGREVertexDeclaration::Clone ( void   ) 

Clones this declaration.


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

Generated on Sun Aug 31 17:46:31 2008 for Digital Spaces by  doxygen 1.5.6