OGRE 14.3
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::Terrain::DefaultGpuBufferAllocator Class Reference

Standard implementation of a buffer allocator which re-uses buffers. More...

#include <OgreTerrain.h>

+ Inheritance diagram for Ogre::Terrain::DefaultGpuBufferAllocator:

Public Member Functions

 DefaultGpuBufferAllocator ()
 
virtual ~DefaultGpuBufferAllocator ()
 
void allocateVertexBuffers (Terrain *forTerrain, size_t numVertices, HardwareVertexBufferSharedPtr &destPos, HardwareVertexBufferSharedPtr &destDelta) override
 Allocate (or reuse) vertex buffers for a terrain LOD.
 
void freeAllBuffers () override
 Free any buffers we're holding.
 
void freeVertexBuffers (const HardwareVertexBufferSharedPtr &posbuf, const HardwareVertexBufferSharedPtr &deltabuf) override
 Free (or return to the pool) vertex buffers for terrain.
 
HardwareIndexBufferSharedPtr getSharedIndexBuffer (uint16 batchSize, uint16 vdatasize, size_t vertexIncrement, uint16 xoffset, uint16 yoffset, uint16 numSkirtRowsCols, uint16 skirtRowColSkip) override
 Get a shared index buffer for a given number of settings.
 
void warmStart (size_t numInstances, uint16 terrainSize, uint16 maxBatchSize, uint16 minBatchSize)
 'Warm start' the allocator based on needing x instances of terrain with the given configuration.
 
- Public Member Functions inherited from Ogre::Terrain::GpuBufferAllocator
 GpuBufferAllocator ()
 
virtual ~GpuBufferAllocator ()
 

Detailed Description

Standard implementation of a buffer allocator which re-uses buffers.

Constructor & Destructor Documentation

◆ DefaultGpuBufferAllocator()

Ogre::Terrain::DefaultGpuBufferAllocator::DefaultGpuBufferAllocator ( )

◆ ~DefaultGpuBufferAllocator()

virtual Ogre::Terrain::DefaultGpuBufferAllocator::~DefaultGpuBufferAllocator ( )
virtual

Member Function Documentation

◆ allocateVertexBuffers()

void Ogre::Terrain::DefaultGpuBufferAllocator::allocateVertexBuffers ( Terrain forTerrain,
size_t  numVertices,
HardwareVertexBufferSharedPtr destPos,
HardwareVertexBufferSharedPtr destDelta 
)
overridevirtual

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

Parameters
forTerrain
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

Implements Ogre::Terrain::GpuBufferAllocator.

◆ freeVertexBuffers()

void Ogre::Terrain::DefaultGpuBufferAllocator::freeVertexBuffers ( const HardwareVertexBufferSharedPtr posbuf,
const HardwareVertexBufferSharedPtr deltabuf 
)
overridevirtual

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

Implements Ogre::Terrain::GpuBufferAllocator.

◆ getSharedIndexBuffer()

HardwareIndexBufferSharedPtr Ogre::Terrain::DefaultGpuBufferAllocator::getSharedIndexBuffer ( uint16  batchSize,
uint16  vdatasize,
size_t  vertexIncrement,
uint16  xoffset,
uint16  yoffset,
uint16  numSkirtRowsCols,
uint16  skirtRowColSkip 
)
overridevirtual

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

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

Implements Ogre::Terrain::GpuBufferAllocator.

◆ freeAllBuffers()

void Ogre::Terrain::DefaultGpuBufferAllocator::freeAllBuffers ( )
overridevirtual

Free any buffers we're holding.

Implements Ogre::Terrain::GpuBufferAllocator.

◆ warmStart()

void Ogre::Terrain::DefaultGpuBufferAllocator::warmStart ( size_t  numInstances,
uint16  terrainSize,
uint16  maxBatchSize,
uint16  minBatchSize 
)

'Warm start' the allocator based on needing x instances of terrain with the given configuration.


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