Work only if ATIVertexArrayObject is enabled. More...
#include <driver_opengl_vertex_buffer_hard.h>
Inherits NL3D::IVertexArrayRange.
Public Member Functions | |
| CVertexArrayRangeATI (CDriverGL *drv) | |
| void | enable () |
| active this VertexArrayRange as the current vertex array range used. | |
| void | disable () |
| disable this VertexArrayRange. | |
| void | freeVB (void *ptr) |
| free a VB allocated with allocateVB. No-op if NULL. | |
| uint | getATIVertexObjectId () const |
| get Handle of the ATI buffer. | |
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 | |
| void * | allocateVB (uint32 size) |
| Allocate a small subset of the memory. NULL if not enough mem. | |
Private Attributes | |
| uint | _VertexObjectId |
| bool | _Allocated |
| uint32 | _VertexArraySize |
| NLMISC::CHeapMemory | _HeapMemory |
Work only if ATIVertexArrayObject is enabled.
else, only call to ctor/dtor/free() is valid. any call to allocateVB() will return NULL.
Definition at line 253 of file driver_opengl_vertex_buffer_hard.h.
| NL3D::CVertexArrayRangeATI::CVertexArrayRangeATI | ( | CDriverGL * | drv | ) |
Definition at line 472 of file driver_opengl_vertex_buffer_hard.cpp.
References _Allocated, _VertexArraySize, _VertexObjectId, and H_AUTO_OGL.
| bool NL3D::CVertexArrayRangeATI::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 480 of file driver_opengl_vertex_buffer_hard.cpp.
References _Allocated, NL3D::IVertexArrayRange::_Driver, _HeapMemory, _VertexArraySize, _VertexObjectId, NL3D::CVertexBuffer::AGPPreferred, NL3D::IDriver::getStaticMemoryToVRAM(), GL_DYNAMIC_ATI, GL_STATIC_ATI, H_AUTO_OGL, NLMISC::CHeapMemory::initHeap(), nglIsObjectBufferATI, nglNewObjectBufferATI, NL3D_DRV_ATI_FAKE_MEM_START, nlassert, and NL3D::CVertexBuffer::StaticPreferred.
| void * NL3D::CVertexArrayRangeATI::allocateVB | ( | uint32 | size | ) | [private] |
Allocate a small subset of the memory. NULL if not enough mem.
Definition at line 599 of file driver_opengl_vertex_buffer_hard.cpp.
References _HeapMemory, NLMISC::CHeapMemory::allocate(), and H_AUTO_OGL.
Referenced by createVBHardGL().
| IVertexBufferHardGL * NL3D::CVertexArrayRangeATI::createVBHardGL | ( | uint | size, | |
| CVertexBuffer * | vb | |||
| ) | [virtual] |
create a IVertexBufferHardGL
Implements NL3D::IVertexArrayRange.
Definition at line 547 of file driver_opengl_vertex_buffer_hard.cpp.
References _Allocated, NL3D::IVertexArrayRange::_Driver, allocateVB(), NL3D::CVertexBufferHardGLATI::createRAMMirror(), H_AUTO_OGL, and NL3D::CVertexBufferHardGLATI::initGL().
| void NL3D::CVertexArrayRangeATI::disable | ( | ) |
disable this VertexArrayRange.
_Driver->_CurrentVertexArrayRange= NULL; NB: no-op for ATI, but ensure correct _Driver->_CurrentVertexArrayRange value.
Definition at line 592 of file driver_opengl_vertex_buffer_hard.cpp.
References NL3D::CDriverGL::_CurrentVertexArrayRange, NL3D::IVertexArrayRange::_Driver, and H_AUTO_OGL.
Referenced by NL3D::CVertexBufferHardGLATI::disable().
| void NL3D::CVertexArrayRangeATI::enable | ( | ) |
active this VertexArrayRange as the current vertex array range used.
no-op if already setup. NB: no-op for ATI, but ensure correct _Driver->_CurrentVertexArrayRange value.
Definition at line 585 of file driver_opengl_vertex_buffer_hard.cpp.
References NL3D::CDriverGL::_CurrentVertexArrayRange, NL3D::IVertexArrayRange::_Driver, and H_AUTO_OGL.
Referenced by NL3D::CVertexBufferHardGLATI::enable().
| void NL3D::CVertexArrayRangeATI::free | ( | ) | [virtual] |
free this space.
Implements NL3D::IVertexArrayRange.
Definition at line 530 of file driver_opengl_vertex_buffer_hard.cpp.
References _Allocated, _HeapMemory, _VertexArraySize, _VertexObjectId, H_AUTO_OGL, nglDeleteObjectBufferATI, and NLMISC::CHeapMemory::reset().
| void NL3D::CVertexArrayRangeATI::freeVB | ( | void * | ptr | ) |
free a VB allocated with allocateVB. No-op if NULL.
Definition at line 605 of file driver_opengl_vertex_buffer_hard.cpp.
References _HeapMemory, NLMISC::CHeapMemory::free(), and H_AUTO_OGL.
Referenced by NL3D::CVertexBufferHardGLATI::~CVertexBufferHardGLATI().
| uint NL3D::CVertexArrayRangeATI::getATIVertexObjectId | ( | ) | const [inline] |
get Handle of the ATI buffer.
Definition at line 287 of file driver_opengl_vertex_buffer_hard.h.
References _VertexObjectId.
Referenced by NL3D::CVertexBufferHardGLATI::getATIVertexObjectId().
| uint NL3D::CVertexArrayRangeATI::sizeAllocated | ( | ) | const [virtual] |
return the size allocated. 0 if not allocated or failure
Implements NL3D::IVertexArrayRange.
Definition at line 524 of file driver_opengl_vertex_buffer_hard.cpp.
References _VertexArraySize, and H_AUTO_OGL.
bool NL3D::CVertexArrayRangeATI::_Allocated [private] |
Definition at line 292 of file driver_opengl_vertex_buffer_hard.h.
Referenced by allocate(), createVBHardGL(), CVertexArrayRangeATI(), and free().
Definition at line 296 of file driver_opengl_vertex_buffer_hard.h.
Referenced by allocate(), allocateVB(), free(), and freeVB().
Definition at line 293 of file driver_opengl_vertex_buffer_hard.h.
Referenced by allocate(), CVertexArrayRangeATI(), free(), and sizeAllocated().
Definition at line 291 of file driver_opengl_vertex_buffer_hard.h.
Referenced by allocate(), CVertexArrayRangeATI(), free(), and getATIVertexObjectId().
1.6.1