Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
SharedHelperForHlms Class Reference

#include <hlms.h>

+ Inheritance diagram for SharedHelperForHlms:

Protected Types

typedef Ogre::vector< Ogre::ConstBufferPacked * >::type ConstBufferPackedVec
 

Protected Member Functions

void bindObjectDataBuffer (Ogre::CommandBuffer *commandBuffer, uint16_t perObjectDataBufferSlot)
 Binds currPerObjectDataBuffer to the right slot. More...
 
float * mapObjectDataBufferFor (uint32_t instanceIdx, Ogre::CommandBuffer *commandBuffer, Ogre::VaoManager *vaoManager, const ConstBufferPackedVec &constBuffers, uint32_t currConstBufferIdx, uint32_t *startMappedConstBuffer, uint16_t perObjectDataBufferSlot, uint16_t element_count)
 
void unmapObjectDataBuffer ()
 Unmaps the current buffer holding per-object data from memory. More...
 
 SharedHelperForHlms ()
 
 ~SharedHelperForHlms ()
 

Protected Attributes

ConstBufferPackedVec mPerObjectDataBuffers
 Vector of buffers holding per-object data. More...
 
Ogre::ConstBufferPacked *ogre_nullable mCurrPerObjectDataBuffer
 The buffer currently use. Can be nullptr. It is contained in mPerObjectDataBuffers. More...
 
Ogre::ConstBufferPacked *ogre_nullable mLastMainConstBuffer
 The last content of mCurrentConstBuffer. More...
 
float *ogre_nullable mCurrPerObjectDataPtr
 The mapped contents of currPerObjectDataBuffer. More...
 
Ogre::VaoManager *ogre_nullable mOwnVaoManager
 Pointer to Ogre's VAO manager. Used here for destroying const buffers. More...
 

Member Typedef Documentation

◆ ConstBufferPackedVec

typedef Ogre::vector<Ogre::ConstBufferPacked*>::type SharedHelperForHlms::ConstBufferPackedVec
protected

Constructor & Destructor Documentation

◆ SharedHelperForHlms()

SharedHelperForHlms::SharedHelperForHlms ( )
protected

◆ ~SharedHelperForHlms()

SharedHelperForHlms::~SharedHelperForHlms ( )
protected

Member Function Documentation

◆ bindObjectDataBuffer()

void SharedHelperForHlms::bindObjectDataBuffer ( Ogre::CommandBuffer *  commandBuffer,
uint16_t  perObjectDataBufferSlot 
)
protected

Binds currPerObjectDataBuffer to the right slot.

Does nothing if it's nullptr.

Parameters
commandBufferCmd buffer to bind to.
perObjectDataBufferSlotSlot to bind the buffer to.
+ Here is the caller graph for this function:

◆ mapObjectDataBufferFor()

float * SharedHelperForHlms::mapObjectDataBufferFor ( uint32_t  instanceIdx,
Ogre::CommandBuffer *  commandBuffer,
Ogre::VaoManager *  vaoManager,
const ConstBufferPackedVec constBuffers,
uint32_t  currConstBufferIdx,
uint32_t startMappedConstBuffer,
uint16_t  perObjectDataBufferSlot,
uint16_t  element_count 
)
protected
Parameters
instanceIdxThe index of the instance to write to.
commandBufferCommand buffer to bind our new buffer if we create one.
vaoManagerVaoManager to create new ConstBufferPacked.
constBuffersReference to mConstBuffers so we can tell if we need to bind a new const buffer.
currConstBufferIdxValue of mCurrentConstBuffer so we can tell if we need to bind a new const buffer.
startMappedConstBufferValue of mStartMappedConstBuffer for validation (to ensure our implementation isn't out of sync with OgreNext's).
perObjectDataBufferSlotSee mapConstBuffer().
Returns
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unmapObjectDataBuffer()

void SharedHelperForHlms::unmapObjectDataBuffer ( )
protected

Unmaps the current buffer holding per-object data from memory.

+ Here is the caller graph for this function:

Member Data Documentation

◆ mCurrPerObjectDataBuffer

Ogre::ConstBufferPacked* ogre_nullable SharedHelperForHlms::mCurrPerObjectDataBuffer
protected

The buffer currently use. Can be nullptr. It is contained in mPerObjectDataBuffers.

◆ mCurrPerObjectDataPtr

float* ogre_nullable SharedHelperForHlms::mCurrPerObjectDataPtr
protected

The mapped contents of currPerObjectDataBuffer.

◆ mLastMainConstBuffer

Ogre::ConstBufferPacked* ogre_nullable SharedHelperForHlms::mLastMainConstBuffer
protected

The last content of mCurrentConstBuffer.

If it changes we need a new mCurrPerObjectDataBuffer too (because drawId will be reset from 0).

◆ mOwnVaoManager

Ogre::VaoManager* ogre_nullable SharedHelperForHlms::mOwnVaoManager
protected

Pointer to Ogre's VAO manager. Used here for destroying const buffers.

◆ mPerObjectDataBuffers

ConstBufferPackedVec SharedHelperForHlms::mPerObjectDataBuffers
protected

Vector of buffers holding per-object data.

When one runs out, we push a new one. On the next frame we reuse them all from 0.


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