OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::v1::VertexBufferBinding Class Reference

Records the state of all the vertex buffer bindings required to provide a vertex declaration with the input data it needs for the vertex elements. More...

#include <OgreHardwareVertexBuffer.h>

+ Inheritance diagram for Ogre::v1::VertexBufferBinding:

Public Types

typedef map< ushort, ushort >::type BindingIndexMap
 
typedef map< unsignedshort, HardwareVertexBufferSharedPtr >::type VertexBufferBindingMap
 Defines the vertex buffer bindings used as source for vertex declarations.
 

Public Member Functions

 VertexBufferBinding ()
 Constructor, should not be called direct, use HardwareBufferManager::createVertexBufferBinding.
 
virtual ~VertexBufferBinding ()
 
virtual void closeGaps (BindingIndexMap &bindingIndexMap)
 Remove any gaps in the bindings.
 
virtual const VertexBufferBindingMapgetBindings (void) const
 Gets a read-only version of the buffer bindings.
 
virtual const HardwareVertexBufferSharedPtrgetBuffer (unsigned short index) const
 Gets the buffer bound to the given source index.
 
virtual size_t getBufferCount (void) const
 
virtual bool getHasInstanceData () const
 Returns true if this binding has an element that contains instance data.
 
virtual unsigned short getLastBoundIndex (void) const
 Gets the last bound index.
 
virtual unsigned short getNextIndex (void) const
 Gets the highest index which has already been set, plus 1.
 
virtual bool hasGaps (void) const
 Check whether any gaps in the bindings.
 
virtual bool isBufferBound (unsigned short index) const
 Gets whether a buffer is bound to the given source index.
 
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
 
virtual void setBinding (unsigned short index, const HardwareVertexBufferSharedPtr &buffer)
 Set a binding, associating a vertex buffer with a given index.
 
virtual void unsetAllBindings (void)
 Removes all the bindings.
 
virtual void unsetBinding (unsigned short index)
 Removes an existing binding.
 

Detailed Description

Records the state of all the vertex buffer bindings required to provide a vertex declaration with the input data it needs for the vertex elements.

Remarks
Why do we have this binding list rather than just have VertexElement referring to the vertex buffers direct? Well, in the underlying APIs, binding the vertex buffers to an index (or 'stream') is the way that vertex data is linked, so this structure better reflects the realities of that. In addition, by separating the vertex declaration from the list of vertex buffer bindings, it becomes possible to reuse bindings between declarations and vice versa, giving opportunities to reduce the state changes required to perform rendering.
Like the other classes in this functional area, these binding maps should be created and destroyed using the HardwareBufferManager.

Member Typedef Documentation

◆ BindingIndexMap

◆ VertexBufferBindingMap

Defines the vertex buffer bindings used as source for vertex declarations.

Constructor & Destructor Documentation

◆ VertexBufferBinding()

Ogre::v1::VertexBufferBinding::VertexBufferBinding ( )

Constructor, should not be called direct, use HardwareBufferManager::createVertexBufferBinding.

◆ ~VertexBufferBinding()

virtual Ogre::v1::VertexBufferBinding::~VertexBufferBinding ( )
virtual

Member Function Documentation

◆ closeGaps()

virtual void Ogre::v1::VertexBufferBinding::closeGaps ( BindingIndexMap bindingIndexMap)
virtual

Remove any gaps in the bindings.

Remarks
This is useful if you've removed vertex buffer from this vertex buffer bindings and want to remove any gaps in the bindings. Note, however, that if this bindings is already being used with a VertexDeclaration, you will need to alter that too. This method is mainly useful when reorganising buffers manually.
Parameters
bindingIndexMapTo be retrieve the binding index map that used to translation old index to new index; will be cleared by this method before fill-in.

◆ getBindings()

virtual const VertexBufferBindingMap & Ogre::v1::VertexBufferBinding::getBindings ( void  ) const
virtual

Gets a read-only version of the buffer bindings.

◆ getBuffer()

virtual const HardwareVertexBufferSharedPtr & Ogre::v1::VertexBufferBinding::getBuffer ( unsigned short  index) const
virtual

Gets the buffer bound to the given source index.

◆ getBufferCount()

virtual size_t Ogre::v1::VertexBufferBinding::getBufferCount ( void  ) const
inlinevirtual

◆ getHasInstanceData()

virtual bool Ogre::v1::VertexBufferBinding::getHasInstanceData ( ) const
virtual

Returns true if this binding has an element that contains instance data.

◆ getLastBoundIndex()

virtual unsigned short Ogre::v1::VertexBufferBinding::getLastBoundIndex ( void  ) const
virtual

Gets the last bound index.

◆ getNextIndex()

virtual unsigned short Ogre::v1::VertexBufferBinding::getNextIndex ( void  ) const
inlinevirtual

Gets the highest index which has already been set, plus 1.

Remarks
This is to assist in binding the vertex buffers such that there are not gaps in the list.

◆ hasGaps()

virtual bool Ogre::v1::VertexBufferBinding::hasGaps ( void  ) const
virtual

Check whether any gaps in the bindings.

◆ isBufferBound()

virtual bool Ogre::v1::VertexBufferBinding::isBufferBound ( unsigned short  index) const
virtual

Gets whether a buffer is bound to the given source index.

◆ 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

◆ setBinding()

virtual void Ogre::v1::VertexBufferBinding::setBinding ( unsigned short  index,
const HardwareVertexBufferSharedPtr buffer 
)
virtual

Set a binding, associating a vertex buffer with a given index.

Remarks
If the index is already associated with a vertex buffer, the association will be replaced. This may cause the old buffer to be destroyed if nothing else is referring to it. You should assign bindings from 0 and not leave gaps, although you can bind them in any order.

◆ unsetAllBindings()

virtual void Ogre::v1::VertexBufferBinding::unsetAllBindings ( void  )
virtual

Removes all the bindings.

◆ unsetBinding()

virtual void Ogre::v1::VertexBufferBinding::unsetBinding ( unsigned short  index)
virtual

Removes an existing binding.


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