My Project
Public Types | Public Member Functions | Protected Attributes | List of all members
ParaEngine::ParaVertexBuffer Class Reference

cross platform vertex/index buffer. More...

#include <ParaVertexBuffer.h>

Inheritance diagram for ParaEngine::ParaVertexBuffer:
ParaEngine::ParaIndexBuffer ParaEngine::ParaMemoryBuffer

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
 

Detailed Description

cross platform vertex/index buffer.

this is light weighted, use this like an int, and copy by value.

Member Function Documentation

§ CreateBuffer()

bool ParaEngine::ParaVertexBuffer::CreateBuffer ( uint32  nBufferSize,
DWORD  dwFormat = 0,
DWORD  dwUsage = 0,
D3DPOOL  dwPool = D3DPOOL_MANAGED 
)

recreate the buffer based on the new size

Parameters
dwFormatonly used in DirectX, ignored in openGL
dwUsageonly used in DirectX, ignored in openGL

§ GetBufferSize()

uint32 ParaEngine::ParaVertexBuffer::GetBufferSize ( )

get the current buffer size.

§ Lock()

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.

§ ReleaseBuffer()

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.


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