# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CVertexBufferHeap Class Reference

A vertex buffer used to group lot of static VB in it. More...

#include <vertex_buffer_heap.h>

List of all members.

Public Methods

 CVertexBufferHeap ()
 Constructor. More...

 ~CVertexBufferHeap ()
Init/Setup
void init (IDriver *driver, uint vertexFormat, uint maxVertices)
 Create the vertex buffer heap. It use a VBHard if possible. else a std CVertexBuffer is used. More...

void release ()
 release the VB. init() can be called after this. More...

bool enabled () const
 false if any error at init, or if init() not called. More...

IDrivergetDriver () const
 return the driver used. More...

uint getVertexFormat () const
 get the vertexFormat. More...

uint getVertexSize () const
 get the vertexSize. More...

uint getMaxVertices () const
 get max vertices the Buffer allows. More...

Allocation.
bool allocate (uint numVertices, uint &indexStart)
 allocate a subset of the VB. false if cannot (not enough space/too big). More...

void free (uint indexStart)
 free a subset of the VB. nlstop if subset not found... More...

Rendering. Those methods must be called only if enabled(), else crash
uint8lock (uint indexStart)
 lock the VB/VBHard, for future filling. More...

void unlock (uint startVert, uint endVert)
 unlock the VB/VBHard. Mirror the IVertexBufferHard::unlock(start, end) scheme. More...

void activate ()
 activate the VB/VBHard as the current VB in the driver, for future rendering. More...


Private Attributes

NLMISC::CRefPtr< IDriver_Driver
NLMISC::CRefPtr< IVertexBufferHard_VBHard
CVertexBuffer _VBSoft
NLMISC::CHeapMemory _HeapManager
uint8_HeapStart
bool _Enabled
bool _HardMode
uint _VertexFormat
uint _VertexSize
uint _MaxVertices


Detailed Description

A vertex buffer used to group lot of static VB in it.

Work with VBHard where available.

Author:
Lionel Berenguier , Nevrax France
Date:
2002

Definition at line 46 of file vertex_buffer_heap.h.


Constructor & Destructor Documentation

NL3D::CVertexBufferHeap::CVertexBufferHeap  
 

Constructor.

Definition at line 38 of file vertex_buffer_heap.cpp.

References _Enabled, _HardMode, _HeapStart, _MaxVertices, _VertexFormat, and _VertexSize.

NL3D::CVertexBufferHeap::~CVertexBufferHeap  
 

Definition at line 50 of file vertex_buffer_heap.cpp.

References release.


Member Function Documentation

void NL3D::CVertexBufferHeap::activate  
 

activate the VB/VBHard as the current VB in the driver, for future rendering.

Definition at line 177 of file vertex_buffer_heap.cpp.

References _Driver, _VBHard, _VBSoft, enabled, and nlassert.

bool NL3D::CVertexBufferHeap::allocate uint    numVertices,
uint   indexStart
 

allocate a subset of the VB. false if cannot (not enough space/too big).

Definition at line 123 of file vertex_buffer_heap.cpp.

References _HeapManager, _HeapStart, _VertexSize, NLMISC::CHeapMemory::allocate, enabled, getVertexSize, and nlassert.

bool NL3D::CVertexBufferHeap::enabled   const [inline]
 

false if any error at init, or if init() not called.

Definition at line 62 of file vertex_buffer_heap.h.

References _Enabled.

Referenced by activate, allocate, free, lock, and unlock.

void NL3D::CVertexBufferHeap::free uint    indexStart
 

free a subset of the VB. nlstop if subset not found...

Definition at line 140 of file vertex_buffer_heap.cpp.

References _HeapManager, _HeapStart, _VertexSize, enabled, NLMISC::CHeapMemory::free, and nlassert.

IDriver* NL3D::CVertexBufferHeap::getDriver void    const [inline]
 

return the driver used.

Definition at line 64 of file vertex_buffer_heap.h.

References _Driver.

uint NL3D::CVertexBufferHeap::getMaxVertices   const [inline]
 

get max vertices the Buffer allows.

Definition at line 70 of file vertex_buffer_heap.h.

References _MaxVertices.

uint NL3D::CVertexBufferHeap::getVertexFormat void    const [inline]
 

get the vertexFormat.

Definition at line 66 of file vertex_buffer_heap.h.

References _VertexFormat.

uint NL3D::CVertexBufferHeap::getVertexSize void    const [inline]
 

get the vertexSize.

Definition at line 68 of file vertex_buffer_heap.h.

References _VertexSize.

Referenced by allocate.

void NL3D::CVertexBufferHeap::init IDriver   driver,
uint    vertexFormat,
uint    maxVertices
 

Create the vertex buffer heap. It use a VBHard if possible. else a std CVertexBuffer is used.

Definition at line 56 of file vertex_buffer_heap.cpp.

References _Driver, _Enabled, _HardMode, _HeapManager, _HeapStart, _MaxVertices, _VBHard, _VBSoft, _VertexFormat, _VertexSize, NLMISC::CHeapMemory::initHeap, nlassert, and release.

uint8 * NL3D::CVertexBufferHeap::lock uint    indexStart
 

lock the VB/VBHard, for future filling.

Definition at line 151 of file vertex_buffer_heap.cpp.

References _HeapStart, _VBHard, _VertexSize, enabled, and nlassert.

void NL3D::CVertexBufferHeap::release  
 

release the VB. init() can be called after this.

Definition at line 101 of file vertex_buffer_heap.cpp.

References _Driver, _Enabled, _HardMode, _HeapManager, _HeapStart, _MaxVertices, _VBHard, _VBSoft, _VertexFormat, _VertexSize, NLMISC::contReset, and nlassert.

Referenced by init, and ~CVertexBufferHeap.

void NL3D::CVertexBufferHeap::unlock uint    startVert,
uint    endVert
 

unlock the VB/VBHard. Mirror the IVertexBufferHard::unlock(start, end) scheme.

Definition at line 169 of file vertex_buffer_heap.cpp.

References _VBHard, enabled, and nlassert.


Member Data Documentation

NLMISC::CRefPtr<IDriver> NL3D::CVertexBufferHeap::_Driver [private]
 

Definition at line 100 of file vertex_buffer_heap.h.

Referenced by activate, getDriver, init, and release.

bool NL3D::CVertexBufferHeap::_Enabled [private]
 

Definition at line 105 of file vertex_buffer_heap.h.

Referenced by CVertexBufferHeap, enabled, init, and release.

bool NL3D::CVertexBufferHeap::_HardMode [private]
 

Definition at line 106 of file vertex_buffer_heap.h.

Referenced by CVertexBufferHeap, init, and release.

NLMISC::CHeapMemory NL3D::CVertexBufferHeap::_HeapManager [private]
 

Definition at line 103 of file vertex_buffer_heap.h.

Referenced by allocate, free, init, and release.

uint8* NL3D::CVertexBufferHeap::_HeapStart [private]
 

Definition at line 104 of file vertex_buffer_heap.h.

Referenced by allocate, CVertexBufferHeap, free, init, lock, and release.

uint NL3D::CVertexBufferHeap::_MaxVertices [private]
 

Definition at line 110 of file vertex_buffer_heap.h.

Referenced by CVertexBufferHeap, getMaxVertices, init, and release.

NLMISC::CRefPtr<IVertexBufferHard> NL3D::CVertexBufferHeap::_VBHard [private]
 

Definition at line 101 of file vertex_buffer_heap.h.

Referenced by activate, init, lock, release, and unlock.

CVertexBuffer NL3D::CVertexBufferHeap::_VBSoft [private]
 

Definition at line 102 of file vertex_buffer_heap.h.

Referenced by activate, init, and release.

uint NL3D::CVertexBufferHeap::_VertexFormat [private]
 

Definition at line 108 of file vertex_buffer_heap.h.

Referenced by CVertexBufferHeap, getVertexFormat, init, and release.

uint NL3D::CVertexBufferHeap::_VertexSize [private]
 

Definition at line 109 of file vertex_buffer_heap.h.

Referenced by allocate, CVertexBufferHeap, free, getVertexSize, init, lock, and release.


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