Cogs.Core
TwinVisualsSystem.h
1#pragma once
2
3#include "Rendering/Common.h"
4
5#include "Resources/Resources.h"
6
7#include "Systems/ComponentSystem.h"
8
9#include "TwinVisualsComponent.h"
10
11namespace Cogs::Core {
12
13 struct TwinVisualsData;
14
16 {
17 void clear(Context* context, TwinVisualsData& visualsData);
18
19 void issue(Context* context, TwinVisualsData& visualsData, const StringView path);
20
21 bool check(Context* context, TwinVisualsData& visualsData);
22
25 };
26
27 enum struct TextureLoadingState : uint32_t {
28 Ready,
29 Loading,
30 Failed
31 };
32
34 {
35 std::string biosphere;
36
37 TwinVisualsMode mode = TwinVisualsMode::Balanced;
38 TwinVisualsTexAtlasStyle texAtlasStyle = TwinVisualsTexAtlasStyle::Color;
39 TwinVisualsQualityPreset qualityPreset = TwinVisualsQualityPreset::Medium;
40 TwinVisualsTonemapper tonemapper = TwinVisualsTonemapper::Reinhard;
41 TwinVisualsDynamicRenderResolution drrPreset = TwinVisualsDynamicRenderResolution::FullQuality;
42 bool useLowRes = false;
43 bool shadowsEnabled = true;
44 bool highlightRegionEnabled = false;
45 bool pbrEnvironmentEnabled = false;
46 bool firstrun = true;
47 float brightness = 0.5f;
48 bool groundPlaneEnabled = false;
49
54
55 TextureLoadingState prevTextureLoadingState = TextureLoadingState::Ready;
56 TextureLoadingState currTextureLoadingState = TextureLoadingState::Ready;
57 bool presentTextures = false;
58 };
59
60 struct TwinVisualsSystem : public ComponentSystemWithDataPool<TwinVisualsComponent, TwinVisualsData>
61 {
63 public:
64 TwinVisualsSystem(Memory::Allocator* allocator, SizeType capacity) : ComponentSystemWithDataPool(allocator, capacity) {}
65
66 void preUpdate(Context* context) override;
67
68 void update(Context* context) override;
69
70 void postUpdate(Context* context) override;
71
73
74 void destroyComponent(ComponentHandle handle) override;
75
76
77 TwinVisualsComponent* globalTwinVisualsComponent = nullptr;
78 };
79}
Context * context
Pointer to the Context instance the system lives in.
void postUpdate()
Perform post update logic in the system.
void update()
Updates the system state to that of the current frame.
void preUpdate()
Run the pre-update method of the system.
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
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:50
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
@ Ready
All 6 baselayers are fully loaded, instance will begin rendering.
ComponentIndex SizeType
Type used to track the size of pools.
Definition: Component.h:19
Handle to a Component instance.
Definition: Component.h:67
static const ResourceHandle_t NoHandle
Handle representing a default (or none if default not present) resource.
ComponentHandle createComponent() override
void destroyComponent(ComponentHandle handle) override