Cogs.Core
InstancedMeshBuilderSystem.h
1#pragma once
2
3#include "Systems/ComponentSystem.h"
4
5#include "Foundation/Memory/MemoryBuffer.h"
6
7#include "Components/Geometry/InstancedMeshBuilderComponent.h"
8
9namespace Cogs::Core
10{
11 class Context;
12
14 {
15 Memory::MemoryBuffer matrices;
16 MeshHandle instanceMesh = MeshHandle::NoHandle;
17 size_t viewStateHash = 0;
18 size_t instanceCount = 0;
19 bool dynamicScaling = false;
20 bool useMatrix = false;
21 bool usePositions = false;
22 bool useColors = false;
23 };
24
25 class InstancedMeshBuilderSystem : public ComponentSystemWithDataPool<InstancedMeshBuilderComponent, InstancedMeshBuilderData>
26 {
27 public:
28 InstancedMeshBuilderSystem(Memory::Allocator * allocator, SizeType capacity) : ComponentSystemWithDataPool(allocator, capacity) {}
29
30 void update(Context* context);
31 };
32}
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
Component system with parallel data per component stored in a pool similar to how the components them...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Base allocator implementation.
Definition: Allocator.h:30
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
ComponentIndex SizeType
Type used to track the size of pools.
Definition: Component.h:19
static const ResourceHandle_t NoHandle
Handle representing a default (or none if default not present) resource.