#include <driver_opengl_vertex_buffer_hard.h>
Inheritance diagram for NL3D::CVertexArrayRangeMapObjectATI:

Definition at line 361 of file driver_opengl_vertex_buffer_hard.h.
Public Member Functions | |
| CVertexArrayRangeMapObjectATI (CDriverGL *drv) | |
| void | disable () |
| void | enable () |
Implementation | |
| virtual bool | allocate (uint32 size, IDriver::TVBHardType vbType) |
| virtual IVertexBufferHardGL * | createVBHardGL (uint16 vertexFormat, const uint8 *typeArray, uint32 numVertices, const uint8 *uvRouting) |
| create a IVertexBufferHardGL | |
| virtual void | free () |
| free this space. | |
| virtual uint | sizeAllocated () const |
| return the size allocated. 0 if not allocated or failure | |
Protected Attributes | |
| CDriverGL * | _Driver |
Private Attributes | |
| uint32 | _SizeAllocated |
| IDriver::TVBHardType | _VBType |
|
|
Definition at line 719 of file driver_opengl_vertex_buffer_hard.cpp.
00719 : IVertexArrayRange(drv), 00720 _VBType(IDriver::VBHardAGP), 00721 _SizeAllocated(0) 00722 { 00723 } |
|
||||||||||||
|
Allocate a vertex array space. false if error. must free before re-allocate. Will always succeed, because vb are not managed in a heap, but are rather kept as separate objects Implements NL3D::IVertexArrayRange. Definition at line 726 of file driver_opengl_vertex_buffer_hard.cpp. References _SizeAllocated, _VBType, GL_DYNAMIC_ATI, GL_STATIC_ATI, GLuint(), nglDeleteObjectBufferATI, nglNewObjectBufferATI, size, and uint32.
00727 {
00728 // We don't manage memory ourselves, but test if there's enough room anyway
00729 GLuint vertexObjectId;
00730 switch(vbType)
00731 {
00732 case IDriver::VBHardAGP:
00733 vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI);
00734 break;
00735 case IDriver::VBHardVRAM:
00736 vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_STATIC_ATI);
00737 break;
00738 }
00739 if (vertexObjectId)
00740 {
00741 // free the object
00742 nglDeleteObjectBufferATI(vertexObjectId);
00743 //
00744 _SizeAllocated = size;
00745 _VBType = vbType;
00746 return true;
00747 }
00748 return false;
00749 }
|
|
||||||||||||||||||||
|
create a IVertexBufferHardGL
Implements NL3D::IVertexArrayRange. Definition at line 758 of file driver_opengl_vertex_buffer_hard.cpp. References _VBType, NL3D::IVertexBufferHard::getNumVertices(), NL3D::IVertexBufferHard::getVertexSize(), GL_DYNAMIC_ATI, GL_STATIC_ATI, NL3D::IVertexBufferHardGL::initFormat(), NL3D::CVertexBufferHardGLMapObjectATI::initGL(), nglIsObjectBufferATI, nglNewObjectBufferATI, size, uint, uint16, uint32, and uint8.
00759 {
00760 // create a ATI VBHard
00761 CVertexBufferHardGLMapObjectATI *newVbHard= new CVertexBufferHardGLMapObjectATI(_Driver);
00762
00763 // Init the format of the VB.
00764 newVbHard->initFormat(vertexFormat, typeArray, numVertices, uvRouting);
00765
00766 // compute size to allocate.
00767 uint32 size= newVbHard->getVertexSize() * newVbHard->getNumVertices();
00768
00769 uint vertexObjectId;
00770 // just allocate a new buffer..
00771 switch(_VBType)
00772 {
00773 case IDriver::VBHardAGP:
00774 vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_DYNAMIC_ATI);
00775 break;
00776 case IDriver::VBHardVRAM:
00777 vertexObjectId = nglNewObjectBufferATI(size, NULL, GL_STATIC_ATI);
00778 break;
00779 };
00780
00781
00782 // init the allocator, if success
00783 if( nglIsObjectBufferATI(vertexObjectId) )
00784 {
00785 newVbHard->initGL(this, vertexObjectId);
00786 return newVbHard;
00787 }
00788 else
00789 {
00790 delete newVbHard;
00791 return false;
00792 }
00793 }
|
|
|
disable this VertexArrayRange. _Driver->_CurrentVertexArrayRange= NULL; NB: no-op for ATI, but ensure correct _Driver->_CurrentVertexArrayRange value. Definition at line 801 of file driver_opengl_vertex_buffer_hard.cpp.
00802 {
00803 }
|
|
|
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 796 of file driver_opengl_vertex_buffer_hard.cpp.
00797 {
00798 }
|
|
|
free this space.
Implements NL3D::IVertexArrayRange. Definition at line 752 of file driver_opengl_vertex_buffer_hard.cpp. References _SizeAllocated.
00753 {
00754 _SizeAllocated = 0;
00755 }
|
|
|
return the size allocated. 0 if not allocated or failure
Implements NL3D::IVertexArrayRange. Definition at line 378 of file driver_opengl_vertex_buffer_hard.h. References _SizeAllocated, and uint.
00378 { return _SizeAllocated; }
|
|
|
Definition at line 69 of file driver_opengl_vertex_buffer_hard.h. |
|
|
Definition at line 395 of file driver_opengl_vertex_buffer_hard.h. Referenced by allocate(), free(), and sizeAllocated(). |
|
|
Definition at line 394 of file driver_opengl_vertex_buffer_hard.h. Referenced by allocate(), and createVBHardGL(). |
1.3.6