Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::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>

List of all members.

Public Types

typedef std::map< unsigned
short, HardwareVertexBufferSharedPtr
VertexBufferBindingMap
 Defines the vertex buffer bindings used as source for vertex declarations.


Public Methods

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

virtual ~VertexBufferBinding ()
virtual void setBinding (unsigned short index, HardwareVertexBufferSharedPtr buffer)
 Set a binding, associating a vertex buffer with a given index.

virtual void unsetBinding (unsigned short index)
 Removes an existing binding.

virtual void unsetAllBindings (void)
 Removes all the bindings.

virtual const VertexBufferBindingMapgetBindings (void) const
 Gets a read-only version of the buffer bindings.

virtual HardwareVertexBufferSharedPtr getBuffer (unsigned short index)
 Gets the buffer bound to the given source index.

virtual size_t getBufferCount (void) const
virtual unsigned short getNextIndex (void) const
 Gets the highest index which has already been set, plus 1.


Protected Attributes

VertexBufferBindingMap mBindingMap
unsigned short mHighIndex


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.

Definition at line 429 of file OgreHardwareVertexBuffer.h.


Member Typedef Documentation

typedef std::map<unsigned short, HardwareVertexBufferSharedPtr> Ogre::VertexBufferBinding::VertexBufferBindingMap
 

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

Definition at line 433 of file OgreHardwareVertexBuffer.h.


Constructor & Destructor Documentation

Ogre::VertexBufferBinding::VertexBufferBinding  
 

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

Definition at line 468 of file OgreHardwareVertexBuffer.cpp.

Ogre::VertexBufferBinding::~VertexBufferBinding   [virtual]
 

Definition at line 472 of file OgreHardwareVertexBuffer.cpp.

References unsetAllBindings().


Member Function Documentation

const VertexBufferBinding::VertexBufferBindingMap & Ogre::VertexBufferBinding::getBindings void    const [virtual]
 

Gets a read-only version of the buffer bindings.

Definition at line 503 of file OgreHardwareVertexBuffer.cpp.

References mBindingMap.

Referenced by Ogre::D3DRenderSystem::_render(), Ogre::VertexData::clone(), Ogre::D3D9RenderSystem::setVertexBufferBinding(), and Ogre::MeshSerializerImpl::writeGeometry().

HardwareVertexBufferSharedPtr Ogre::VertexBufferBinding::getBuffer unsigned short    index [virtual]
 

Gets the buffer bound to the given source index.

Definition at line 508 of file OgreHardwareVertexBuffer.cpp.

References Except, and mBindingMap.

Referenced by Ogre::TerrainRenderable::_calculateNormals(), Ogre::BillboardSet::_createBuffers(), Ogre::TerrainRenderable::_generateVertexLighting(), Ogre::BillboardSet::_notifyCurrentCamera(), Ogre::GLRenderSystem::_render(), Ogre::ProgressiveMesh::addWorkingData(), Ogre::BspLevel::buildQuake3Patches(), Ogre::Mesh::buildTangentVectors(), Ogre::EdgeListBuilder::buildTrianglesEdges(), Ogre::Entity::EntityShadowRenderable::EntityShadowRenderable(), Ogre::Entity::extractTempBufferInfo(), Ogre::BorderPanelGuiElement::getCellUVString(), Ogre::EdgeListBuilder::log(), Ogre::Mesh::organiseTangentsBuffer(), Ogre::VertexData::prepareForShadowVolume(), Ogre::Entity::EntityShadowRenderable::rebindPositionBuffer(), Ogre::VertexData::reorganiseBuffers(), Ogre::BorderPanelGuiElement::setCellUV(), Ogre::Rectangle2D::setCorners(), Ogre::WireBoundingBox::setupBoundingBoxVertices(), Ogre::Mesh::softwareVertexBlend(), Ogre::TextAreaGuiElement::updateColours(), Ogre::Frustum::updateFrustum(), Ogre::TextAreaGuiElement::updateGeometry(), Ogre::PanelGuiElement::updatePositionGeometry(), Ogre::BorderPanelGuiElement::updatePositionGeometry(), Ogre::PanelGuiElement::updateTextureGeometry(), and Ogre::TTYGuiElement::updateWindowGeometry().

virtual size_t Ogre::VertexBufferBinding::getBufferCount void    const [virtual]
 

Definition at line 462 of file OgreHardwareVertexBuffer.h.

virtual unsigned short Ogre::VertexBufferBinding::getNextIndex void    const [virtual]
 

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.

Definition at line 469 of file OgreHardwareVertexBuffer.h.

Referenced by Ogre::Mesh::compileBoneAssignments(), and Ogre::VertexData::prepareForShadowVolume().

void Ogre::VertexBufferBinding::setBinding unsigned short    index,
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.

Definition at line 477 of file OgreHardwareVertexBuffer.cpp.

References mBindingMap, and mHighIndex.

Referenced by Ogre::BillboardSet::_createBuffers(), Ogre::TerrainRenderable::_notifyCurrentCamera(), Ogre::TempBlendedBufferInfo::bindTempCopies(), Ogre::TTYGuiElement::checkMemoryAllocation(), Ogre::TextAreaGuiElement::checkMemoryAllocation(), Ogre::VertexData::clone(), Ogre::Mesh::compileBoneAssignments(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::MeshManager::createPrefabPlane(), Ogre::Entity::EntityShadowRenderable::EntityShadowRenderable(), Ogre::Frustum::Frustum(), Ogre::TerrainRenderable::initialise(), Ogre::PanelGuiElement::initialise(), Ogre::BorderPanelGuiElement::initialise(), Ogre::PatchMesh::load(), Ogre::BspLevel::loadQuake3Level(), Ogre::Mesh::organiseTangentsBuffer(), Ogre::VertexData::prepareForShadowVolume(), Ogre::MeshSerializerImpl_v1_2::readGeometryColours(), Ogre::MeshSerializerImpl_v1_2::readGeometryNormals(), Ogre::MeshSerializerImpl_v1_2::readGeometryPositions(), Ogre::MeshSerializerImpl_v1_1::readGeometryTexCoords(), Ogre::MeshSerializerImpl_v1_2::readGeometryTexCoords(), Ogre::MeshSerializerImpl::readGeometryVertexBuffer(), Ogre::Entity::EntityShadowRenderable::rebindPositionBuffer(), Ogre::Rectangle2D::Rectangle2D(), Ogre::VertexData::reorganiseBuffers(), Ogre::PanelGuiElement::updateTextureGeometry(), and Ogre::WireBoundingBox::WireBoundingBox().

void Ogre::VertexBufferBinding::unsetAllBindings void    [virtual]
 

Removes all the bindings.

Definition at line 497 of file OgreHardwareVertexBuffer.cpp.

References mBindingMap.

Referenced by ~VertexBufferBinding().

void Ogre::VertexBufferBinding::unsetBinding unsigned short    index [virtual]
 

Removes an existing binding.

Definition at line 485 of file OgreHardwareVertexBuffer.cpp.

References Except, and mBindingMap.

Referenced by Ogre::Entity::cloneVertexDataRemoveBlendInfo(), and Ogre::Mesh::compileBoneAssignments().


Member Data Documentation

VertexBufferBindingMap Ogre::VertexBufferBinding::mBindingMap [protected]
 

Definition at line 435 of file OgreHardwareVertexBuffer.h.

Referenced by getBindings(), getBuffer(), setBinding(), unsetAllBindings(), and unsetBinding().

unsigned short Ogre::VertexBufferBinding::mHighIndex [protected]
 

Definition at line 436 of file OgreHardwareVertexBuffer.h.

Referenced by setBinding().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:46 2004