Work only if ARRAY_RANGE_NV is enabled. More...
#include <driver_opengl_vertex_buffer_hard.h>
Inherits NL3D::IVertexArrayRange.
Public Member Functions | |
| CVertexArrayRangeNVidia (CDriverGL *drv) | |
| void | enable () |
| active this VertexArrayRange as the current vertex array range used. no-op if already setup. | |
| void | disable () |
| disable this VertexArrayRange. _Driver->_CurrentVertexArrayRange= NULL; | |
| void | freeVB (void *ptr) |
| free a VB allocated with allocateVB. No-op if NULL. | |
Implementation | |
| virtual bool | allocate (uint32 size, CVertexBuffer::TPreferredMemory vbType) |
| allocate a vertex array sapce. false if error. must free before re-allocate. | |
| virtual void | free () |
| free this space. | |
| virtual IVertexBufferHardGL * | createVBHardGL (uint size, CVertexBuffer *vb) |
| create a IVertexBufferHardGL | |
| virtual uint | sizeAllocated () const |
| return the size allocated. 0 if not allocated or failure | |
Private Member Functions | |
| bool | allocated () const |
| true if allocated. | |
| void * | allocateVB (uint32 size) |
| Allocate a small subset of the memory. NULL if not enough mem. | |
Private Attributes | |
| void * | _VertexArrayPtr |
| uint32 | _VertexArraySize |
| NLMISC::CHeapMemory | _HeapMemory |
Work only if ARRAY_RANGE_NV is enabled.
else, only call to ctor/dtor/free() is valid. any call to allocateVB() will return NULL.
Definition at line 136 of file driver_opengl_vertex_buffer_hard.h.
| NL3D::CVertexArrayRangeNVidia::CVertexArrayRangeNVidia | ( | CDriverGL * | drv | ) |
Definition at line 99 of file driver_opengl_vertex_buffer_hard.cpp.
References _VertexArrayPtr, _VertexArraySize, and H_AUTO_OGL.
| bool NL3D::CVertexArrayRangeNVidia::allocate | ( | uint32 | size, | |
| CVertexBuffer::TPreferredMemory | vbType | |||
| ) | [virtual] |
allocate a vertex array sapce. false if error. must free before re-allocate.
Implements NL3D::IVertexArrayRange.
Definition at line 108 of file driver_opengl_vertex_buffer_hard.cpp.
References NL3D::IVertexArrayRange::_Driver, _HeapMemory, _VertexArrayPtr, _VertexArraySize, NL3D::CVertexBuffer::AGPPreferred, NL3D::IDriver::getStaticMemoryToVRAM(), H_AUTO_OGL, NLMISC::CHeapMemory::initHeap(), nlassert, and NL3D::CVertexBuffer::StaticPreferred.
| bool NL3D::CVertexArrayRangeNVidia::allocated | ( | ) | const [inline, private] |
true if allocated.
Definition at line 174 of file driver_opengl_vertex_buffer_hard.h.
References _VertexArrayPtr.
Referenced by createVBHardGL().
| void * NL3D::CVertexArrayRangeNVidia::allocateVB | ( | uint32 | size | ) | [private] |
Allocate a small subset of the memory. NULL if not enough mem.
Definition at line 218 of file driver_opengl_vertex_buffer_hard.cpp.
References _HeapMemory, NLMISC::CHeapMemory::allocate(), and H_AUTO_OGL.
Referenced by createVBHardGL().
| IVertexBufferHardGL * NL3D::CVertexArrayRangeNVidia::createVBHardGL | ( | uint | size, | |
| CVertexBuffer * | vb | |||
| ) | [virtual] |
create a IVertexBufferHardGL
Implements NL3D::IVertexArrayRange.
Definition at line 234 of file driver_opengl_vertex_buffer_hard.cpp.
References NL3D::IVertexArrayRange::_Driver, allocated(), allocateVB(), H_AUTO_OGL, and NL3D::CVertexBufferHardGLNVidia::initGL().
| void NL3D::CVertexArrayRangeNVidia::disable | ( | ) |
disable this VertexArrayRange. _Driver->_CurrentVertexArrayRange= NULL;
Definition at line 203 of file driver_opengl_vertex_buffer_hard.cpp.
References NL3D::CDriverGL::_CurrentVertexArrayRange, NL3D::IVertexArrayRange::_Driver, NL3D::CDriverGL::_Extensions, H_AUTO_OGL, and NL3D::CGlExtensions::NVStateVARWithoutFlush.
Referenced by NL3D::CVertexBufferHardGLNVidia::disable().
| void NL3D::CVertexArrayRangeNVidia::enable | ( | ) |
active this VertexArrayRange as the current vertex array range used. no-op if already setup.
Definition at line 177 of file driver_opengl_vertex_buffer_hard.cpp.
References NL3D::CDriverGL::_CurrentVertexArrayRange, NL3D::IVertexArrayRange::_Driver, NL3D::CDriverGL::_Extensions, NL3D::CDriverGL::_NVCurrentVARPtr, NL3D::CDriverGL::_NVCurrentVARSize, _VertexArrayPtr, _VertexArraySize, H_AUTO_OGL, nglVertexArrayRangeNV, and NL3D::CGlExtensions::NVStateVARWithoutFlush.
Referenced by NL3D::CVertexBufferHardGLNVidia::enable().
| void NL3D::CVertexArrayRangeNVidia::free | ( | ) | [virtual] |
free this space.
Implements NL3D::IVertexArrayRange.
Definition at line 156 of file driver_opengl_vertex_buffer_hard.cpp.
References _HeapMemory, _VertexArrayPtr, _VertexArraySize, H_AUTO_OGL, and NLMISC::CHeapMemory::reset().
| void NL3D::CVertexArrayRangeNVidia::freeVB | ( | void * | ptr | ) |
free a VB allocated with allocateVB. No-op if NULL.
Definition at line 226 of file driver_opengl_vertex_buffer_hard.cpp.
References _HeapMemory, NLMISC::CHeapMemory::free(), and H_AUTO_OGL.
Referenced by NL3D::CVertexBufferHardGLNVidia::~CVertexBufferHardGLNVidia().
| uint NL3D::CVertexArrayRangeNVidia::sizeAllocated | ( | ) | const [virtual] |
return the size allocated. 0 if not allocated or failure
Implements NL3D::IVertexArrayRange.
Definition at line 148 of file driver_opengl_vertex_buffer_hard.cpp.
References _VertexArraySize, and H_AUTO_OGL.
Definition at line 171 of file driver_opengl_vertex_buffer_hard.h.
Referenced by allocate(), allocateVB(), free(), and freeVB().
void* NL3D::CVertexArrayRangeNVidia::_VertexArrayPtr [private] |
Definition at line 167 of file driver_opengl_vertex_buffer_hard.h.
Referenced by allocate(), allocated(), CVertexArrayRangeNVidia(), enable(), and free().
Definition at line 168 of file driver_opengl_vertex_buffer_hard.h.
Referenced by allocate(), CVertexArrayRangeNVidia(), enable(), free(), and sizeAllocated().
1.6.1