Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Protected Attributes
render::VertexBufferBinding Class Reference

#include <VertexBuffer.h>

List of all members.

Public Member Functions

virtual const std::map< u16,
VertexBuffer * > & 
getBindings () const
 Gets a read-only version of the buffer bindings.
virtual VertexBuffergetBuffer (u16 index)
 Gets the buffer bound to the given source index.
virtual u16 getNextIndex ()
virtual void setBinding (u16 index, VertexBuffer *buffer)
virtual void unsetAllBindings ()
 Removes all the bindings.
virtual void unsetBinding (u16 index)
 Removes an existing binding.
 VertexBufferBinding ()
virtual ~VertexBufferBinding ()

Protected Attributes

std::map< u16, VertexBuffer * > mBindingMap
u16 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.

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 to perform rendering.

Constructor & Destructor Documentation

render::VertexBufferBinding::VertexBufferBinding ( )

References mHighIndex.

render::VertexBufferBinding::~VertexBufferBinding ( ) [virtual]

References unsetAllBindings().

Member Function Documentation

const std::map< u16, VertexBuffer * > & render::VertexBufferBinding::getBindings ( ) const [virtual]

Gets a read-only version of the buffer bindings.

References mBindingMap.

VertexBuffer * render::VertexBufferBinding::getBuffer ( u16  index) [virtual]
u16 render::VertexBufferBinding::getNextIndex ( ) [virtual]

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

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

References mHighIndex.

void render::VertexBufferBinding::setBinding ( u16  index,
VertexBuffer buffer 
) [virtual]

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

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.

References mBindingMap, and mHighIndex.

Referenced by render::TextOverlay::allocateMemory(), render::DebugRenderable::initializeGeometry(), and render::PanelOverlay::initializeImpl().

void render::VertexBufferBinding::unsetAllBindings ( ) [virtual]

Removes all the bindings.

References mBindingMap.

Referenced by ~VertexBufferBinding().

void render::VertexBufferBinding::unsetBinding ( u16  index) [virtual]

Removes an existing binding.

References engine::LogManager::getInstance(), core::intToString(), engine::LL_ERROR, and mBindingMap.

Member Data Documentation

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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:09 by Doxygen (1.7.4)