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

Specialisation of VertexDeclaration for D3D9. More...

#include <OgreD3D9VertexDeclaration.h>

+ Inheritance diagram for Ogre::D3D9VertexDeclaration:
+ Collaboration diagram for Ogre::D3D9VertexDeclaration:

Public Types

typedef list< VertexElement >::type VertexElementList
 Defines the list of vertex elements that makes up this declaration. More...
 

Public Member Functions

 D3D9VertexDeclaration ()
 
 ~D3D9VertexDeclaration ()
 
const VertexElementaddElement (unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
 See VertexDeclaration. More...
 
virtual VertexDeclarationclone (HardwareBufferManagerBase *mgr=0)
 Clones this declaration. More...
 
void closeGapsInSource (void)
 Remove any gaps in the source buffer list used by this declaration. More...
 
virtual const VertexElementfindElementBySemantic (VertexElementSemantic sem, unsigned short index=0)
 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)
 Based on the current elements, gets the size of the vertex for a given buffer source. More...
 
VertexDeclarationgetAutoOrganisedDeclaration (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. More...
 
IDirect3DVertexDeclaration9 * getD3DVertexDeclaration (void)
 Gets the D3D9-specific vertex declaration. More...
 
const VertexElementgetElement (unsigned short index)
 Get a single element. More...
 
size_t getElementCount (void)
 Get the number of elements in the declaration. More...
 
const VertexElementListgetElements (void) const
 Gets read-only access to the list of vertex elements. More...
 
unsigned short getMaxSource (void) const
 Gets the index of the highest source value referenced by this declaration. More...
 
virtual size_t getVertexSize (unsigned short source)
 Gets the vertex size defined by this declaration for a given source. More...
 
const VertexElementinsertElement (unsigned short atPosition, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
 See VertexDeclaration. More...
 
void modifyElement (unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
 See VertexDeclaration. More...
 
virtual void notifyOnDeviceCreate (IDirect3DDevice9 *d3d9Device)
 
virtual void notifyOnDeviceDestroy (IDirect3DDevice9 *d3d9Device)
 
virtual void notifyOnDeviceLost (IDirect3DDevice9 *d3d9Device)
 
virtual void notifyOnDeviceReset (IDirect3DDevice9 *d3d9Device)
 
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 VertexDeclaration &rhs) const
 
bool operator== (const VertexDeclaration &rhs) const
 
void removeAllElements (void)
 See VertexDeclaration. More...
 
void removeElement (unsigned short elem_index)
 See VertexDeclaration. More...
 
void removeElement (VertexElementSemantic semantic, unsigned short index=0)
 See VertexDeclaration. More...
 
void sort (void)
 Sorts the elements in this list to be compatible with the maximum number of rendering APIs / graphics cards. More...
 

Static Public Member Functions

static void lockDeviceAccess ()
 
static void unlockDeviceAccess ()
 
static bool vertexElementLess (const VertexElement &e1, const VertexElement &e2)
 Sort routine for vertex elements. More...
 

Protected Types

typedef
DeviceToDeclarationMap::iterator 
DeviceToDeclarationIterator
 
typedef map< IDirect3DDevice9
*, IDirect3DVertexDeclaration9 * >
::type 
DeviceToDeclarationMap
 

Protected Member Functions

void releaseDeclaration ()
 

Protected Attributes

VertexElementList mElementList
 
DeviceToDeclarationMap mMapDeviceToDeclaration
 

Detailed Description

Specialisation of VertexDeclaration for D3D9.

Definition at line 38 of file OgreD3D9VertexDeclaration.h.

Member Typedef Documentation

typedef DeviceToDeclarationMap::iterator Ogre::D3D9VertexDeclaration::DeviceToDeclarationIterator
protected

Definition at line 83 of file OgreD3D9VertexDeclaration.h.

typedef map<IDirect3DDevice9*, IDirect3DVertexDeclaration9*>::type Ogre::D3D9VertexDeclaration::DeviceToDeclarationMap
protected

Definition at line 82 of file OgreD3D9VertexDeclaration.h.

Defines the list of vertex elements that makes up this declaration.

Definition at line 309 of file OgreHardwareVertexBuffer.h.

Constructor & Destructor Documentation

Ogre::D3D9VertexDeclaration::D3D9VertexDeclaration ( )
Ogre::D3D9VertexDeclaration::~D3D9VertexDeclaration ( )

Member Function Documentation

const VertexElement& Ogre::D3D9VertexDeclaration::addElement ( unsigned short  source,
size_t  offset,
VertexElementType  theType,
VertexElementSemantic  semantic,
unsigned short  index = 0 
)
virtual

See VertexDeclaration.

Reimplemented from Ogre::VertexDeclaration.

virtual VertexDeclaration* Ogre::VertexDeclaration::clone ( HardwareBufferManagerBase mgr = 0)
virtualinherited

Clones this declaration.

Parameters
mgrOptional HardwareBufferManager to use for creating the clone (if null, use the current default).
void Ogre::VertexDeclaration::closeGapsInSource ( void  )
inherited

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.
virtual const VertexElement* Ogre::VertexDeclaration::findElementBySemantic ( VertexElementSemantic  sem,
unsigned short  index = 0 
)
virtualinherited

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.
virtual VertexElementList Ogre::VertexDeclaration::findElementsBySource ( unsigned short  source)
virtualinherited

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

Parameters
sourceThe 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.
VertexDeclaration* Ogre::VertexDeclaration::getAutoOrganisedDeclaration ( bool  skeletalAnimation,
bool  vertexAnimation 
)
inherited

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.

Remarks
Different buffer organisations and buffer usages will be returned depending on the parameters passed to this method.
Parameters
skeletalAnimationWhether this vertex data is going to be skeletally animated
vertexAnimationWhether this vertex data is going to be vertex animated
IDirect3DVertexDeclaration9* Ogre::D3D9VertexDeclaration::getD3DVertexDeclaration ( void  )

Gets the D3D9-specific vertex declaration.

const VertexElement* Ogre::VertexDeclaration::getElement ( unsigned short  index)
inherited

Get a single element.

size_t Ogre::VertexDeclaration::getElementCount ( void  )
inlineinherited

Get the number of elements in the declaration.

Definition at line 320 of file OgreHardwareVertexBuffer.h.

const VertexElementList& Ogre::VertexDeclaration::getElements ( void  ) const
inherited

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

unsigned short Ogre::VertexDeclaration::getMaxSource ( void  ) const
inherited

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

virtual size_t Ogre::VertexDeclaration::getVertexSize ( unsigned short  source)
virtualinherited

Gets the vertex size defined by this declaration for a given source.

const VertexElement& Ogre::D3D9VertexDeclaration::insertElement ( unsigned short  atPosition,
unsigned short  source,
size_t  offset,
VertexElementType  theType,
VertexElementSemantic  semantic,
unsigned short  index = 0 
)
virtual

See VertexDeclaration.

Reimplemented from Ogre::VertexDeclaration.

static void Ogre::D3D9Resource::lockDeviceAccess ( )
staticinherited
void Ogre::D3D9VertexDeclaration::modifyElement ( unsigned short  elem_index,
unsigned short  source,
size_t  offset,
VertexElementType  theType,
VertexElementSemantic  semantic,
unsigned short  index = 0 
)
virtual

See VertexDeclaration.

Reimplemented from Ogre::VertexDeclaration.

virtual void Ogre::D3D9VertexDeclaration::notifyOnDeviceCreate ( IDirect3DDevice9 *  d3d9Device)
virtual

Reimplemented from Ogre::D3D9Resource.

virtual void Ogre::D3D9VertexDeclaration::notifyOnDeviceDestroy ( IDirect3DDevice9 *  d3d9Device)
virtual

Reimplemented from Ogre::D3D9Resource.

virtual void Ogre::D3D9Resource::notifyOnDeviceLost ( IDirect3DDevice9 *  d3d9Device)
inlinevirtualinherited
virtual void Ogre::D3D9Resource::notifyOnDeviceReset ( IDirect3DDevice9 *  d3d9Device)
inlinevirtualinherited
template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 95 of file OgreMemoryAllocatedObject.h.

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

Definition at line 101 of file OgreMemoryAllocatedObject.h.

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

Definition at line 107 of file OgreMemoryAllocatedObject.h.

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

Definition at line 112 of file OgreMemoryAllocatedObject.h.

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

Definition at line 118 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 67 of file OgreMemoryAllocatedObject.h.

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

Definition at line 72 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 78 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 85 of file OgreMemoryAllocatedObject.h.

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

Definition at line 90 of file OgreMemoryAllocatedObject.h.

bool Ogre::VertexDeclaration::operator!= ( const VertexDeclaration rhs) const
inlineinherited

Definition at line 463 of file OgreHardwareVertexBuffer.h.

bool Ogre::VertexDeclaration::operator== ( const VertexDeclaration rhs) const
inlineinherited

Definition at line 446 of file OgreHardwareVertexBuffer.h.

References Ogre::VertexDeclaration::mElementList.

void Ogre::D3D9VertexDeclaration::releaseDeclaration ( )
protected
void Ogre::D3D9VertexDeclaration::removeAllElements ( void  )
virtual

See VertexDeclaration.

Reimplemented from Ogre::VertexDeclaration.

void Ogre::D3D9VertexDeclaration::removeElement ( unsigned short  elem_index)
virtual

See VertexDeclaration.

Reimplemented from Ogre::VertexDeclaration.

void Ogre::D3D9VertexDeclaration::removeElement ( VertexElementSemantic  semantic,
unsigned short  index = 0 
)
virtual

See VertexDeclaration.

Reimplemented from Ogre::VertexDeclaration.

void Ogre::VertexDeclaration::sort ( void  )
inherited

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.
static void Ogre::D3D9Resource::unlockDeviceAccess ( )
staticinherited
static bool Ogre::VertexDeclaration::vertexElementLess ( const VertexElement e1,
const VertexElement e2 
)
staticinherited

Sort routine for vertex elements.

Member Data Documentation

VertexElementList Ogre::VertexDeclaration::mElementList
protectedinherited

Definition at line 313 of file OgreHardwareVertexBuffer.h.

Referenced by Ogre::VertexDeclaration::operator==().

DeviceToDeclarationMap Ogre::D3D9VertexDeclaration::mMapDeviceToDeclaration
protected

Definition at line 85 of file OgreD3D9VertexDeclaration.h.


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