Cogs.Core
TexAtlasRenderer.h
1#pragma once
2#include "Renderer/IRenderer.h"
3#include "Resources/MaterialInstance.h"
4
5namespace Cogs::Core {
6
7 struct TexAtlasSystem;
8
10 {
11 explicit TexAtlasRenderer(TexAtlasSystem* texAtlasSystem) : texAtlasSystem(texAtlasSystem) {}
12 ~TexAtlasRenderer() override;
13
14 void initialize(Context* context, IGraphicsDevice* device) override;
15 void handleEvent(uint32_t eventId, const DrawContext* renderingContext) override;
16 void generateCommands(const RenderTaskContext* renderingContext, RenderList* renderList) override;
17
18 TexAtlasSystem* texAtlasSystem = nullptr;
19
20 struct {
21 MeshStreamsLayout streamsLayout;
23 Cogs::BufferHandle paramBuffer;
24 } fullScreenTriangle;
25
26 // WebGL on VR headsets have an issue with copy/blits from texture arrays, so we use shader instead
27 struct {
33
39 } atlasBlit;
40
41
42 glm::vec4 frustumCorners[8];
43 bool renderFrustum = false;
44
45 MeshStreamsLayout wireStreamsLayout;
46 MaterialHandle debugMaterial;
47 MaterialInstanceHandle debugMaterialNoneInstance;
48 MaterialInstanceHandle debugMaterialEvalInstance;
49
50 Cogs::IGraphicsDevice* device = nullptr;
51 Cogs::VertexBufferHandle wireBoxVertices;
52 Cogs::IndexBufferHandle wireBoxIndices;
53 Cogs::BufferHandle wireBoxConstants;
54 uint32_t wireBoxIndexStride = 0;
55 uint32_t wireBoxIndexCount = 0;
56
57 };
58
59}
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 handleEvent(uint32_t eventId, const DrawContext *renderingContext) override
Called when rendering events occur.
void initialize(Context *context, IGraphicsDevice *device) override
Initialize the extension using the given context and device.
static const Handle_t NoHandle
Represents a handle to nothing.
Definition: Common.h:78