Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
#include <VertexBuffer.h>
Public Member Functions | |
virtual const std::map< u16, VertexBuffer * > & | getBindings () const |
Gets a read-only version of the buffer bindings. | |
virtual VertexBuffer * | getBuffer (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 |
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.
render::VertexBufferBinding::VertexBufferBinding | ( | ) |
References mHighIndex.
render::VertexBufferBinding::~VertexBufferBinding | ( | ) | [virtual] |
References unsetAllBindings().
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] |
Gets the buffer bound to the given source index.
References mBindingMap.
Referenced by render::TextOverlay::updatePositionBinding(), render::PanelOverlay::updatePositionBinding(), and render::PanelOverlay::updateTextureBinding().
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] |
void render::VertexBufferBinding::unsetBinding | ( | u16 | index | ) | [virtual] |
Removes an existing binding.
References engine::LogManager::getInstance(), core::intToString(), engine::LL_ERROR, and mBindingMap.
std::map<u16, VertexBuffer*> render::VertexBufferBinding::mBindingMap [protected] |
Referenced by getBindings(), getBuffer(), setBinding(), unsetAllBindings(), and unsetBinding().
u16 render::VertexBufferBinding::mHighIndex [protected] |
Referenced by getNextIndex(), setBinding(), and VertexBufferBinding().
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:09 by
Doxygen
(1.7.4)
|