OGRE
14.2
Object-Oriented Graphics Rendering Engine
|
Standard implementation of a buffer allocator which re-uses buffers. More...
#include <OgreTerrain.h>
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. More... | |
void | freeAllBuffers () override |
Free any buffers we're holding. More... | |
void | freeVertexBuffers (const HardwareVertexBufferSharedPtr &posbuf, const HardwareVertexBufferSharedPtr &deltabuf) override |
Free (or return to the pool) vertex buffers for terrain. More... | |
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. More... | |
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. More... | |
Public Member Functions inherited from Ogre::Terrain::GpuBufferAllocator | |
GpuBufferAllocator () | |
virtual | ~GpuBufferAllocator () |
Standard implementation of a buffer allocator which re-uses buffers.
Ogre::Terrain::DefaultGpuBufferAllocator::DefaultGpuBufferAllocator | ( | ) |
|
virtual |
|
overridevirtual |
Allocate (or reuse) vertex buffers for a terrain LOD.
forTerrain | |
numVertices | The total number of vertices |
destPos | Pointer to a vertex buffer for positions, to be bound |
destDelta | Pointer to a vertex buffer for deltas, to be bound |
Implements Ogre::Terrain::GpuBufferAllocator.
|
overridevirtual |
Free (or return to the pool) vertex buffers for terrain.
Implements Ogre::Terrain::GpuBufferAllocator.
|
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.
batchSize | The batch size along one edge |
vdatasize | The size of the referenced vertex data along one edge |
vertexIncrement | The number of vertices to increment for each new indexed row / column |
xoffset | The x offset from the start of vdatasize, at that resolution |
yoffset | The y offset from the start of vdatasize, at that resolution |
numSkirtRowsCols | Number of rows and columns of skirts |
skirtRowColSkip | The number of rows / cols to skip in between skirts |
Implements Ogre::Terrain::GpuBufferAllocator.
|
overridevirtual |
Free any buffers we're holding.
Implements Ogre::Terrain::GpuBufferAllocator.
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.