|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CVegetableVBAllocator Class ReferenceA VB allocator (landscape like).
More...
#include <vegetablevb_allocator.h>
List of all members.
VB mgt . |
void | deleteVertexBufferHard () |
| delete only the Vertexbuffer hard. More...
|
void | allocateVertexBufferAndFillVBHard (uint32 numVertices) |
void | setupVBFormat () |
CVertexBuffer | _VB |
NLMISC::CRefPtr< IDriver > | _Driver |
bool | _VBHardOk |
NLMISC::CRefPtr< IVertexBufferHard > | _VBHard |
bool | _BufferLocked |
uint8 * | _AGPBufferPtr |
uint | _MaxVertexInBufferHard |
| Maximum vertices in BufferHard allowed for this VBAllocator. More...
|
Public Types |
enum | TVBType { VBTypeLighted = 0,
VBTypeUnlit,
VBTypeCount
} |
Public Methods |
| CVegetableVBAllocator () |
| Constructor. More...
|
| ~CVegetableVBAllocator () |
void | init (TVBType vbType, uint maxVertexInBufferHard) |
| init the VB allocator, with the good type. More...
|
void | updateDriver (IDriver *driver) |
| setup driver, and test for possible VBHard reallocation. More...
|
void | clear () |
|
bool | exceedMaxVertexInBufferHard (uint numAddVerts) const |
| if I add numAddVerts vertices, will it overide _MaxVertexInBufferHard ?? More...
|
uint | getNumUserVerticesAllocated () const |
| return number of vertices allocated with allocateVertex() (NB: do not return the actual number of vertices allocated in VBuffer, but the number of vertices asked to be allocated). More...
|
uint | allocateVertex () |
| Allocate free vertices in VB. More...
|
void | deleteVertex (uint vid) |
| Delete free vertices in VB. (AGP or RAM). More...
|
|
void * | getVertexPointer (uint i) |
| get the software VB pointer to the ith index. valid only beetween 2 allocateVertex(). More...
|
const CVertexBuffer & | getSoftwareVertexBuffer () const |
void | flushVertex (uint i) |
| If VBHard ok, copy the vertex in AGP. Warning: buffer must be locked! More...
|
void | lockBuffer () |
| if any, lock the AGP buffer. More...
|
void | unlockBuffer () |
| if any, unlock the AGP buffer. More...
|
bool | bufferLocked () const |
void | activate () |
| activate the VB or the VBHard in Driver setuped. More...
|
Private Attributes |
TVBType | _Type |
std::vector< uint > | _VertexFreeMemory |
std::vector< CVertexInfo > | _VertexInfos |
uint | _NumVerticesAllocated |
Detailed Description
A VB allocator (landscape like).
Big difference is that here, we do not really matter about reallocation because both software and hardware VB are present. Also, VertexProgram MUST be supported by driver here. NB: unlike Landscape VBAllocator, the VertexProgram is not managed by this class. -
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2001
Definition at line 58 of file vegetablevb_allocator.h.
Member Enumeration Documentation
enum NL3D::CVegetableVBAllocator::TVBType
|
|
Constructor & Destructor Documentation
NL3D::CVegetableVBAllocator::CVegetableVBAllocator |
( |
|
) |
|
|
NL3D::CVegetableVBAllocator::~CVegetableVBAllocator |
( |
|
) |
|
|
Member Function Documentation
void NL3D::CVegetableVBAllocator::activate |
( |
|
) |
|
|
uint NL3D::CVegetableVBAllocator::allocateVertex |
( |
|
) |
|
|
|
Allocate free vertices in VB.
(RAM and AGP if possible). work with locked or unlocked buffer. if VBHard reallocation occurs, VB is unlocked, destroyed, reallocated, and refilled.
Definition at line 185 of file vegetablevb_allocator.cpp.
References _MaxVertexInBufferHard, _NumVerticesAllocated, _VertexFreeMemory, _VertexInfos, allocateVertexBufferAndFillVBHard, id, NL3D_VEGETABLE_VERTEX_ALLOCATE_SECURITY, NL3D_VEGETABLE_VERTEX_ALLOCATE_START, and nlassert. |
void NL3D::CVegetableVBAllocator::allocateVertexBufferAndFillVBHard |
( |
uint32 |
numVertices |
) |
[private] |
|
|
Definition at line 306 of file vegetablevb_allocator.cpp.
References _AGPBufferPtr, _Driver, _MaxVertexInBufferHard, _VB, _VBHard, _VBHardOk, bufferLocked, lockBuffer, nlassert, and unlockBuffer.
Referenced by allocateVertex, and updateDriver. |
bool NL3D::CVegetableVBAllocator::bufferLocked |
( |
|
) |
const [inline] |
|
void NL3D::CVegetableVBAllocator::clear |
( |
|
) |
|
|
void NL3D::CVegetableVBAllocator::deleteVertex |
( |
uint |
vid |
) |
|
|
void NL3D::CVegetableVBAllocator::deleteVertexBufferHard |
( |
|
) |
[private] |
|
bool NL3D::CVegetableVBAllocator::exceedMaxVertexInBufferHard |
( |
uint |
numAddVerts |
) |
const |
|
void NL3D::CVegetableVBAllocator::flushVertex |
( |
uint |
i |
) |
|
|
uint NL3D::CVegetableVBAllocator::getNumUserVerticesAllocated |
( |
|
) |
const |
|
const CVertexBuffer& NL3D::CVegetableVBAllocator::getSoftwareVertexBuffer |
( |
|
) |
const [inline] |
|
void * NL3D::CVegetableVBAllocator::getVertexPointer |
( |
uint |
i |
) |
|
|
void NL3D::CVegetableVBAllocator::init |
( |
TVBType |
vbType, |
|
|
uint |
maxVertexInBufferHard |
|
) |
|
|
|
init the VB allocator, with the good type.
must do it first. maxVertexInBufferHard is the maximum vertex allowed to reside in AGP mem. if More are allocated, then VBHard is disabled, and replaced with software VB (slower!), for ever.
Definition at line 72 of file vegetablevb_allocator.cpp.
References _MaxVertexInBufferHard, _Type, setupVBFormat, and type. |
void NL3D::CVegetableVBAllocator::lockBuffer |
( |
|
) |
|
|
void NL3D::CVegetableVBAllocator::setupVBFormat |
( |
|
) |
[private] |
|
void NL3D::CVegetableVBAllocator::unlockBuffer |
( |
|
) |
|
|
void NL3D::CVegetableVBAllocator::updateDriver |
( |
IDriver * |
driver |
) |
|
|
|
setup driver, and test for possible VBHard reallocation.
if reallocation, refill the VBHard to do anytime you're not sure of change of the driver/vbHard state. -
Parameters:
-
Definition at line 89 of file vegetablevb_allocator.cpp.
References _BufferLocked, _Driver, _MaxVertexInBufferHard, _NumVerticesAllocated, _VBHard, _VBHardOk, allocateVertexBufferAndFillVBHard, deleteVertexBufferHard, and nlassert. |
Member Data Documentation
uint8* NL3D::CVegetableVBAllocator::_AGPBufferPtr [private]
|
|
bool NL3D::CVegetableVBAllocator::_BufferLocked [private]
|
|
uint NL3D::CVegetableVBAllocator::_MaxVertexInBufferHard [private]
|
|
uint NL3D::CVegetableVBAllocator::_NumVerticesAllocated [private]
|
|
TVBType NL3D::CVegetableVBAllocator::_Type [private]
|
|
bool NL3D::CVegetableVBAllocator::_VBHardOk [private]
|
|
std::vector<uint> NL3D::CVegetableVBAllocator::_VertexFreeMemory [private]
|
|
std::vector<CVertexInfo> NL3D::CVegetableVBAllocator::_VertexInfos [private]
|
|
The documentation for this class was generated from the following files:
|
|