Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
#include <MemoryVertexBuffer.h>
Public Member Functions | |
void * | lock (u32 offset, u32 length, resource::BufferLocking options) |
MemoryVertexBuffer (u32 vertexSize, u32 numVertices, resource::BufferUsage usage) | |
void | readData (u32 offset, u32 length, void *pDest) |
void | unlock () |
void | writeData (u32 offset, u32 length, const void *pSource, bool discardWholeBuffer=false) |
virtual | ~MemoryVertexBuffer () |
Protected Member Functions | |
void * | lockImpl (u32 offset, u32 length, resource::BufferLocking options) |
Internal implementation of lock(). | |
void | unlockImpl () |
Internal implementation of unlock(). | |
Protected Attributes | |
u8 * | mpData |
render::MemoryVertexBuffer::MemoryVertexBuffer | ( | u32 | vertexSize, |
u32 | numVertices, | ||
resource::BufferUsage | usage | ||
) |
References mpData, and resource::Buffer::mSizeInBytes.
render::MemoryVertexBuffer::~MemoryVertexBuffer | ( | ) | [virtual] |
References mpData.
void * render::MemoryVertexBuffer::lock | ( | u32 | offset, |
u32 | length, | ||
resource::BufferLocking | options | ||
) | [virtual] |
Lock the buffer for (potentially) reading / writing.
offset,: | The byte offset from the start of the buffer to lock |
length,: | The size of the area to lock, in bytes |
options,: | Locking options |
Reimplemented from resource::Buffer.
References resource::Buffer::mIsLocked, and mpData.
void * render::MemoryVertexBuffer::lockImpl | ( | u32 | offset, |
u32 | length, | ||
resource::BufferLocking | options | ||
) | [protected, virtual] |
Reads data from the buffer and places it in the memory pointed to by pDest.
offset,: | The byte offset from the start of the buffer to read |
length,: | The size of the area to read, in bytes |
pDest,: | The area of memory in which to place the data, must be large enough to accommodate the data! |
Implements resource::Buffer.
References mpData, and resource::Buffer::mSizeInBytes.
void render::MemoryVertexBuffer::unlock | ( | ) | [virtual] |
Releases the lock on this buffer.
Locking and unlocking a buffer can, in some rare circumstances such as switching video modes whilst the buffer is locked, corrupt the contents of a buffer. This is pretty rare, but if it occurs, this method will throw an exception, meaning you must re-upload the data. Note that using the 'read' and 'write' forms of updating the buffer does not suffer from this problem, so if you want to be 100% sure your data will not be lost, use the 'read' and 'write' forms instead.
Reimplemented from resource::Buffer.
References resource::Buffer::mIsLocked.
void render::MemoryVertexBuffer::unlockImpl | ( | ) | [protected, virtual] |
Internal implementation of unlock().
Implements resource::Buffer.
void render::MemoryVertexBuffer::writeData | ( | u32 | offset, |
u32 | length, | ||
const void * | pSource, | ||
bool | discardWholeBuffer = false |
||
) | [virtual] |
Writes data to the buffer from an area of system memory; note that you must ensure that your buffer is big enough.
offset,: | The byte offset from the start of the buffer to start writing |
length,: | The size of the data to write to, in bytes |
pSource,: | The source of the data to be written |
discardWholeBuffer,: | If true, this allows the driver to discard the entire buffer when writing, such that DMA stalls can be avoided; use if you can. |
Implements resource::Buffer.
References mpData, and resource::Buffer::mSizeInBytes.
u8* render::MemoryVertexBuffer::mpData [protected] |
Referenced by lock(), lockImpl(), MemoryVertexBuffer(), readData(), writeData(), and ~MemoryVertexBuffer().
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:08 by
Doxygen
(1.7.4)
|