#include <vertexbuffer.h>
Inheritance diagram for VertexBuffer:
Public Types | |
enum | BUFFERTYPE { DYNAMIC = 0x00000000, STATIC = 0x00000001, READPRIORITIZED = 0x00000002, WRITEPRIORITIZED = 0x00000004, NOREADWRITE = 0x00000008, NORENDER = 0x00000010, NORMAL = ( DYNAMIC | READPRIORITIZED | WRITEPRIORITIZED ) } |
Buffer type identifiers. Any combination of the flags is valid. More... | |
enum | BUFFERUPLOADPOLICY { ONUNLOCK, ONRENDER, ONFLUSH } |
Upload policy identifiers. More... | |
enum | BUFFERLOCK { READ = 1, WRITE = 2, NOUPLOAD = 4, FORCEUPLOAD = 8 } |
Lock type identifiers. More... | |
Public Member Functions | |
VertexBuffer (unsigned int uiType, unsigned int uiNumVertices, const VertexDeclaration *pkFormat, const void *pData=0) | |
virtual | ~VertexBuffer () |
virtual void | AllocateVertices (unsigned int uiNumVertices, const VertexDeclaration *pkFormat, const void *pData=0) |
void | LoadVertexData (const void *pData) |
void * | GetVertex (unsigned int uiElement=0) |
const VertexDeclaration * | GetVertexFormat () const |
unsigned int | GetVertexSize () const |
virtual const void * | GetRenderData () |
bool | Lock (unsigned int uiLockType) |
void | Unlock () |
virtual void | Upload () |
bool | IsLocked () const |
bool | IsDirty () const |
unsigned int | GetType () const |
unsigned int | GetNumAllocated () const |
unsigned int | GetNumElements () const |
void | SetNumElements (unsigned int uiNumElements) |
void | IncRef () |
void | DecRef () |
int | GetRefCount () const |
Static Public Member Functions | |
std::string | GetTypeAsString (unsigned int uiType) |
unsigned int | GetTypeFromString (std::string const &strType) |
Static Public Attributes | |
BUFFERUPLOADPOLICY | s_eUploadPolicy |
Protected Member Functions | |
virtual bool | AcquireLock () |
virtual void | ReleaseLock () |
Protected Attributes | |
VertexDeclaration * | m_pkVertexFormat |
unsigned int | m_uiVertexFormatSize |
unsigned char * | m_pucBuffer |
unsigned char * | m_pucVertices |
unsigned int | m_uiType |
unsigned int | m_uiLock |
bool | m_bDirty |
unsigned int | m_uiNumAllocated |
unsigned int | m_uiNumCurrent |
|
Buffer type identifiers. Any combination of the flags is valid.
|
|
Upload policy identifiers.
|
|
Lock type identifiers.
|
|
|
|
|
|
Called by Lock. Lock type member m_uiLock has been set at this point
Implements Buffer. |
|
Called by Unlock when a lock should be released. Lock type member m_uiLock is still holding lock type at this point. Implements Buffer. |
|
Resize buffer. There must not be any active lock held on buffer when calling this method
|
|
Load data into buffer. Data must have same internal layout and size as vertex buffer format. An active WRITE lock must have been acquired on the buffer prior to calling this method.
|
|
Get ptr to element
|
|
|
|
Get size of a single element in array
|
|
Get pointer to render data. Used by derived buffer classes in device with AGP/video RAM storage to return pointer to data used for rendering.
|
|
Lock buffer for read/write operation
|
|
Unlock buffer |
|
Upload data to backing store, reset dirty flag |
|
|
|
|
|
|
|
|
|
|
|
Set new count of currently used elements
|
|
Get buffer type as string
|
|
Get buffer type from string
|
|
Increase reference count |
|
Decrease reference count and garbage collect if 0 |
|
|
|
Vertex format declaration |
|
Size of a vertex |
|
Real buffer pointer |
|
Read/write access buffer pointer |
|
Buffer type |
|
Current lock type held |
|
Dirty flag |
|
Number of allocated elements |
|
Number of currently used elements |
|
Buffer upload policy |