FMeshBatch

namespace marengine
class FMeshBatch : public IMeshBatch

Subclassed by FMeshBatchStatic

Public Functions

void reset() override
const FVertexArray &getVertices() const final
const FIndicesArray &getIndices() const final
const FTransformsArray &getTransforms() const final
void updateVertices(const Entity &entity) final
void updateIndices(const Entity &entity) final
void updateTransform(const Entity &entity) final
void passVBO(int32 index) final
void passIBO(int32 index) final
void passTransformSSBO(int32 index) final
int32 getVBO() const final
int32 getIBO() const final
int32 getTransformSSBO() const final
void passMeshStorage(FMeshStorage *pMeshStorage) final
void passMaterialStorage(FMaterialStorage *pMaterialStorage) final

Protected Attributes

FVertexArray p_vertices
FIndicesArray p_indices
FTransformsArray p_transforms
FMeshStorage *p_pMeshStorage = {nullptr}
FMaterialStorage *p_pMaterialStorage = {nullptr}
int32 p_vbo = {-1}
int32 p_ibo = {-1}
int32 p_transformSSBO = {-1}
class FMeshBatchFactory : public IMeshBatchFactory

Public Functions

FMeshBatchStaticColor *emplaceStaticColor() final
FMeshBatchStaticTex2D *emplaceStaticTex2D() final
template<typename TMeshBatchStorage>
FMeshBatchStatic *emplaceStatic(TMeshBatchStorage *pMeshBatchStorage)
FMeshBatchStorage *getStorage() const
void passMeshStorage(FMeshStorage *pMeshStorage)
void passMaterialStorage(FMaterialStorage *pMaterialStorage)

Private Members

FMeshBatchStorage m_storage
FMeshStorage *m_pMeshStorage = {nullptr}
FMaterialStorage *m_pMaterialStorage = {nullptr}
class FMeshBatchStatic : public FMeshBatch

Subclassed by FMeshBatchStaticColor, FMeshBatchStaticTex2D

Public Functions

void reset() override
bool shouldBeBatched(const Entity &entity) const override
bool canBeBatched(const Entity &entity) const override
void submitToBatch(const Entity &entity) override

Protected Functions

void submitRenderable(CRenderable &cRenderable)
void submitVertices(CRenderable &cRenderable, const FVertexArray &vertices)
void submitIndices(CRenderable &cRenderable, const FIndicesArray &indices)
void submitTransform(const CTransform &transformComponent)

Protected Attributes

float p_shapeID = {0.f}
uint32_t p_indicesMaxValue = {0}
class FMeshBatchStaticColor : public FMeshBatchStatic

Public Functions

void reset() override
bool shouldBeBatched(const Entity &entity) const override
bool canBeBatched(const Entity &entity) const override
void submitToBatch(const Entity &entity) override
const FColorsArray &getColors() const
void updateColor(const Entity &entity)
int32 getColorSSBO() const
void passColorSSBO(int32 id)
EBatchType getType() const final

Private Functions

void submitColor(const maths::vec4 &color)

Private Members

FColorsArray m_colors
int32 m_colorsSSBO = {-1}
class FMeshBatchStaticTex2D : public FMeshBatchStatic

Public Functions

void reset() override
bool shouldBeBatched(const Entity &entity) const override
bool canBeBatched(const Entity &entity) const override
void submitToBatch(const Entity &entity) override
EBatchType getType() const final
const std::vector<int32> &getTextureIndexes() const

Private Functions

void submitTexture(FMaterialTex2D *pTexture2D)

Private Members

std::vector<int32> m_textureIndexes
class FMeshBatchStorage : public IMeshBatchStorage

Public Functions

FMeshBatchStorageStaticColor *getStorageStaticColor() const final
FMeshBatchStorageStaticTex2D *getStorageStaticTex2D() const final
FMeshBatch *retrieve(const CRenderable &cRenderable) const
void reset() final

Private Members

FMeshBatchStorageStaticColor m_storageStaticColor
FMeshBatchStorageStaticTex2D m_storageStaticTex2D

Friends

friend class FMeshBatchFactory
class FMeshBatchStorageStaticColor

Public Functions

FMeshBatchStaticColor *get(int32 index) const
uint32 getCount() const
bool isEmpty() const
auto getArray() -> decltype(&m_meshBatches) const

Private Members

std::vector<FMeshBatchStaticColor> m_meshBatches
class FMeshBatchStorageStaticTex2D

Public Functions

FMeshBatchStaticTex2D *get(int32 index) const
uint32 getCount() const
bool isEmpty() const
auto getArray() -> decltype(&m_meshBatches) const

Private Members

std::vector<FMeshBatchStaticTex2D> m_meshBatches