OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::Terrain::GpuBufferAllocator Class Referenceabstract

Interface used to by the Terrain instance to allocate GPU buffers. More...

#include <OgreTerrain.h>

+ Inheritance diagram for Ogre::Terrain::GpuBufferAllocator:
+ Collaboration diagram for Ogre::Terrain::GpuBufferAllocator:

Public Member Functions

 GpuBufferAllocator ()
 
virtual ~GpuBufferAllocator ()
 
virtual void allocateVertexBuffers (Terrain *forTerrain, size_t numVertices, HardwareVertexBufferSharedPtr &destPos, HardwareVertexBufferSharedPtr &destDelta)=0
 Allocate (or reuse) vertex buffers for a terrain LOD. More...
 
virtual void freeAllBuffers ()=0
 Free any buffers we're holding. More...
 
virtual void freeVertexBuffers (const HardwareVertexBufferSharedPtr &posbuf, const HardwareVertexBufferSharedPtr &deltabuf)=0
 Free (or return to the pool) vertex buffers for terrain. More...
 
virtual
HardwareIndexBufferSharedPtr 
getSharedIndexBuffer (uint16 batchSize, uint16 vdatasize, size_t vertexIncrement, uint16 xoffset, uint16 yoffset, uint16 numSkirtRowsCols, uint16 skirtRowColSkip)=0
 Get a shared index buffer for a given number of settings. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 

Detailed Description

Interface used to by the Terrain instance to allocate GPU buffers.

Remarks
This class exists to make it easier to re-use buffers between multiple instances of terrain.

Definition at line 536 of file OgreTerrain.h.

Constructor & Destructor Documentation

Ogre::Terrain::GpuBufferAllocator::GpuBufferAllocator ( )
inline

Definition at line 539 of file OgreTerrain.h.

virtual Ogre::Terrain::GpuBufferAllocator::~GpuBufferAllocator ( )
inlinevirtual

Definition at line 540 of file OgreTerrain.h.

Member Function Documentation

virtual void Ogre::Terrain::GpuBufferAllocator::allocateVertexBuffers ( Terrain forTerrain,
size_t  numVertices,
HardwareVertexBufferSharedPtr destPos,
HardwareVertexBufferSharedPtr destDelta 
)
pure virtual

Allocate (or reuse) vertex buffers for a terrain LOD.

Parameters
numVerticesThe total number of vertices
destPosPointer to a vertex buffer for positions, to be bound
destDeltaPointer to a vertex buffer for deltas, to be bound

Implemented in Ogre::Terrain::DefaultGpuBufferAllocator.

virtual void Ogre::Terrain::GpuBufferAllocator::freeAllBuffers ( )
pure virtual

Free any buffers we're holding.

Implemented in Ogre::Terrain::DefaultGpuBufferAllocator.

virtual void Ogre::Terrain::GpuBufferAllocator::freeVertexBuffers ( const HardwareVertexBufferSharedPtr posbuf,
const HardwareVertexBufferSharedPtr deltabuf 
)
pure virtual

Free (or return to the pool) vertex buffers for terrain.

Implemented in Ogre::Terrain::DefaultGpuBufferAllocator.

virtual HardwareIndexBufferSharedPtr Ogre::Terrain::GpuBufferAllocator::getSharedIndexBuffer ( uint16  batchSize,
uint16  vdatasize,
size_t  vertexIncrement,
uint16  xoffset,
uint16  yoffset,
uint16  numSkirtRowsCols,
uint16  skirtRowColSkip 
)
pure virtual

Get a shared index buffer for a given number of settings.

Remarks
Since all index structures are the same at the same LOD level and relative position, we can share index buffers. Therefore the buffer returned from this method does not need to be 'freed' like the vertex buffers since it is never owned.
Parameters
batchSizeThe batch size along one edge
vdatasizeThe size of the referenced vertex data along one edge
vertexIncrementThe number of vertices to increment for each new indexed row / column
xoffsetThe x offset from the start of vdatasize, at that resolution
yoffsetThe y offset from the start of vdatasize, at that resolution
numSkirtRowsColsNumber of rows and columns of skirts
skirtRowColSkipThe number of rows / cols to skip in between skirts

Implemented in Ogre::Terrain::DefaultGpuBufferAllocator.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.


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