Cogs.Core
HighlightRegionRenderer.h
1#pragma once
2
3#include "Rendering/IGraphicsDevice.h"
4#include "Renderer/IRenderer.h"
5#include "Resources/MeshStreamsLayout.h"
6
7namespace Cogs::Core
8{
9 class Context;
10 struct RenderList;
11 struct RenderTarget;
12 struct RenderTexture;
13 struct HighlightRegionSystem;
14
16 {
17 public:
18 HighlightRegionRenderer(HighlightRegionSystem* hrSystem) : hrSystem(hrSystem) {}
19
20 void initialize(Context* context, IGraphicsDevice* device) override;
21 void handleEvent(uint32_t eventId, const DrawContext* renderingContext) override;
22 void generateCommands(const RenderTaskContext* renderingContext, RenderList* renderList) override;
23
24 void render(RenderTaskContext* renderTaskContext, RenderTarget* renderTarget, RenderList* renderList, RenderTexture* color, RenderTexture* depth);
25
26 HighlightRegionSystem* hrSystem = nullptr;
27 MeshStreamsLayout solidStreamsLayout;
28 MeshStreamsLayout splitCubeStreamsLayout;
29
30 Cogs::VertexBufferHandle cubeVertices;
31 Cogs::IndexBufferHandle cubeTriIndices;
32 uint32_t cubeTriIndicesCount = 0;
33
34 Cogs::VertexBufferHandle splitCubeVertices;
35 Cogs::IndexBufferHandle splitCubeTriIndices;
36 uint32_t splitCubeTriIndicesCount = 0;
37
38 // See comment in render()
39 Cogs::DepthStencilStateHandle noWriteDepthStencilState;
40 Cogs::DepthStencilStateHandle noWriteDepthStencilStateReverse;
41
42 struct {
43 Cogs::BufferHandle buffer;
44 ConstantBufferKey index = NoProperty;
45 } matrices;
46
47 };
48
49}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Defines an extension to the renderer, capable of doing custom rendering.
Definition: IRenderer.h:123
Represents a graphics device used to manage graphics resources and issue drawing commands.
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
void initialize(Context *context, IGraphicsDevice *device) override
Initialize the extension using the given context and device.
void handleEvent(uint32_t eventId, const DrawContext *renderingContext) override
Called when rendering events occur.