#include <W3DBufferManager.h>
Classes | |
| struct | W3DIndexBuffer |
| struct | W3DIndexBufferSlot |
| struct | W3DRenderTask |
| struct | W3DVertexBuffer |
| struct | W3DVertexBufferSlot |
Public Types | |
| enum | VBM_FVF_TYPES { VBM_FVF_XYZ , VBM_FVF_XYZD , VBM_FVF_XYZUV , VBM_FVF_XYZDUV , VBM_FVF_XYZUV2 , VBM_FVF_XYZDUV2 , VBM_FVF_XYZN , VBM_FVF_XYZND , VBM_FVF_XYZNUV , VBM_FVF_XYZNDUV , VBM_FVF_XYZNUV2 , VBM_FVF_XYZNDUV2 , VBM_FVF_XYZRHW , VBM_FVF_XYZRHWD , VBM_FVF_XYZRHWUV , VBM_FVF_XYZRHWDUV , VBM_FVF_XYZRHWUV2 , VBM_FVF_XYZRHWDUV2 , MAX_FVF } |
Public Member Functions | |
| W3DBufferManager (void) | |
| ~W3DBufferManager (void) | |
| W3DVertexBufferSlot * | getSlot (VBM_FVF_TYPES fvfType, Int size) |
| return free vertex buffer memory slot. | |
| W3DIndexBufferSlot * | getSlot (Int size) |
| return free index buffer memory slot. | |
| void | releaseSlot (W3DVertexBufferSlot *vbSlot) |
| return slot to pool | |
| void | releaseSlot (W3DIndexBufferSlot *vbSlot) |
| return slot to pool | |
| void | freeAllSlots (void) |
| release all slots to pool. | |
| void | freeAllBuffers (void) |
| release all vertex buffers to pool. | |
| void | ReleaseResources (void) |
| release D3D/W3D resources. | |
| Bool | ReAcquireResources (void) |
| W3DVertexBuffer * | getNextVertexBuffer (W3DVertexBuffer *pVb, VBM_FVF_TYPES type) |
| allows iterating over vertex buffers used by manager. Input of NULL to get first. | |
Static Public Member Functions | |
| static Int | getDX8Format (VBM_FVF_TYPES format) |
| translates our vertex format into D3D equivalent | |
Protected Member Functions | |
| W3DVertexBufferSlot * | allocateSlotStorage (VBM_FVF_TYPES fvfType, Int size) |
| allocate new memory inside a vertex buffer. | |
| W3DIndexBufferSlot * | allocateSlotStorage (Int size) |
Definition at line 50 of file W3DBufferManager.h.
Definition at line 54 of file W3DBufferManager.h.
| W3DBufferManager::W3DBufferManager | ( | void | ) |
Definition at line 58 of file W3DBufferManager.cpp.
| W3DBufferManager::~W3DBufferManager | ( | void | ) |
Definition at line 76 of file W3DBufferManager.cpp.
|
protected |
Reserves space inside existing index buffer or allocates a new one to fit the required size.
Definition at line 369 of file W3DBufferManager.cpp.
|
protected |
allocate new memory inside a vertex buffer.
Reserves space inside existing vertex buffer or allocates a new one to fit the required size.
Definition at line 255 of file W3DBufferManager.cpp.
| void W3DBufferManager::freeAllBuffers | ( | void | ) |
release all vertex buffers to pool.
<release all slots to pool.
Definition at line 131 of file W3DBufferManager.cpp.
| void W3DBufferManager::freeAllSlots | ( | void | ) |
release all slots to pool.
Definition at line 82 of file W3DBufferManager.cpp.
|
static |
translates our vertex format into D3D equivalent
Definition at line 53 of file W3DBufferManager.cpp.
|
inline |
allows iterating over vertex buffers used by manager. Input of NULL to get first.
Definition at line 141 of file W3DBufferManager.h.
| W3DBufferManager::W3DIndexBufferSlot * W3DBufferManager::getSlot | ( | Int | size | ) |
return free index buffer memory slot.
Searches through previously allocated index buffer slots and returns a matching type. If none found, creates a new slot and adds it to the pool. Returns an integer slotId used to reference the VB. Returns -1 in case of failure.
Definition at line 329 of file W3DBufferManager.cpp.
| W3DBufferManager::W3DVertexBufferSlot * W3DBufferManager::getSlot | ( | VBM_FVF_TYPES | fvfType, |
| Int | size ) |
return free vertex buffer memory slot.
Searches through previously allocated vertex buffer slots and returns a matching type. If none found, creates a new slot and adds it to the pool. Returns an integer slotId used to reference the VB. Returns -1 in case of failure.
Definition at line 215 of file W3DBufferManager.cpp.
| Bool W3DBufferManager::ReAcquireResources | ( | void | ) |
reaquire D3D/W3D resources.
Definition at line 183 of file W3DBufferManager.cpp.
| void W3DBufferManager::ReleaseResources | ( | void | ) |
release D3D/W3D resources.
Definition at line 163 of file W3DBufferManager.cpp.
| void W3DBufferManager::releaseSlot | ( | W3DIndexBufferSlot * | ibSlot | ) |
return slot to pool
Returns index buffer space back to pool so it can be reused later
Definition at line 356 of file W3DBufferManager.cpp.
| void W3DBufferManager::releaseSlot | ( | W3DVertexBufferSlot * | vbSlot | ) |
return slot to pool
Returns vertex buffer space back to pool so it can be reused later
Definition at line 242 of file W3DBufferManager.cpp.
|
protected |
Definition at line 171 of file W3DBufferManager.h.
|
protected |
Definition at line 168 of file W3DBufferManager.h.
|
protected |
Definition at line 157 of file W3DBufferManager.h.
|
protected |
Definition at line 160 of file W3DBufferManager.h.
|
protected |
holds unallocated index buffer wrappers which were never initialized
Definition at line 170 of file W3DBufferManager.h.
|
protected |
holds unallocated vertex buffer wrappers which were never initialized
Definition at line 159 of file W3DBufferManager.h.
|
protected |
holds unallocated slot wrappers which were never initialized
Definition at line 167 of file W3DBufferManager.h.
|
protected |
holds allocated index buffers of each type.
Definition at line 165 of file W3DBufferManager.h.
|
protected |
holds previously allocated slots that are free to fill again.
Definition at line 163 of file W3DBufferManager.h.
|
protected |
holds unallocated slot wrappers which were never initialized
Definition at line 156 of file W3DBufferManager.h.
|
protected |
holds allocated vertex buffers of each type.
Definition at line 154 of file W3DBufferManager.h.
|
protected |
holds previously allocated slots that are free to fill again.
Definition at line 152 of file W3DBufferManager.h.