My Project
|
cross platform vertex/index buffer. More...
#include <ParaVertexBuffer.h>
Public Types | |
enum | EnumBufferType { BufferType_VertexBuffer = 0, BufferType_IndexBuffer, BufferType_MemoryBuffer } |
Public Member Functions | |
VertexBufferDevicePtr_type | GetDevicePointer () |
IndexBufferDevicePtr_type | GetDevicePointerAsIndexBuffer () |
char * | GetMemoryPointer () |
bool | CreateBuffer (uint32 nBufferSize, DWORD dwFormat=0, DWORD dwUsage=0, D3DPOOL dwPool=D3DPOOL_MANAGED) |
recreate the buffer based on the new size More... | |
bool | CreateIndexBuffer (uint32 nBufferSize, DWORD dwFormat=0, DWORD dwUsage=0) |
bool | CreateMemoryBuffer (uint32 nBufferSize, DWORD dwFormat=0, DWORD dwUsage=0) |
void | ReleaseBuffer () |
release the buffer. More... | |
bool | Lock (void **ppData, uint32 offsetToLock=0, uint32 sizeToLock=0, DWORD dwFlag=0) |
lock and return a writable buffer into which one can fill the buffer. More... | |
void | Unlock () |
unlock the buffer | |
uint32 | GetBufferSize () |
get the current buffer size. More... | |
bool | IsValid () const |
boolean: test validity | |
operator bool () const | |
bool | operator! () const |
void | RendererRecreated () |
void | UploadMemoryBuffer (const char *pBuffer, int32 nBufSize=-1) |
Protected Attributes | |
union { | |
IndexBufferDevicePtr_type m_indexBuffer | |
VertexBufferDevicePtr_type m_vertexBuffer | |
}; | |
uint32 | m_nBufferSize |
char * | m_buffer |
EnumBufferType | m_bufferType |
cross platform vertex/index buffer.
this is light weighted, use this like an int, and copy by value.
bool ParaEngine::ParaVertexBuffer::CreateBuffer | ( | uint32 | nBufferSize, |
DWORD | dwFormat = 0 , |
||
DWORD | dwUsage = 0 , |
||
D3DPOOL | dwPool = D3DPOOL_MANAGED |
||
) |
recreate the buffer based on the new size
dwFormat | only used in DirectX, ignored in openGL |
dwUsage | only used in DirectX, ignored in openGL |
uint32 ParaEngine::ParaVertexBuffer::GetBufferSize | ( | ) |
get the current buffer size.
bool ParaEngine::ParaVertexBuffer::Lock | ( | void ** | ppData, |
uint32 | offsetToLock = 0 , |
||
uint32 | sizeToLock = 0 , |
||
DWORD | dwFlag = 0 |
||
) |
lock and return a writable buffer into which one can fill the buffer.
void ParaEngine::ParaVertexBuffer::ReleaseBuffer | ( | ) |
release the buffer.
Please note one must manually call this function. The function will not be called when class is destroyed.