Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
BaseRenderer.hpp
1#pragma once
2
3#include <entt/entt.hpp>
4#include <glm/glm.hpp>
5
6#include <Common/Rendering/GeometryRenderingStats.hpp>
7#include <Common/Graphics/CommandBuffer.hpp>
8
9namespace Grindstone {
10 namespace GraphicsAPI {
11 class RenderPass;
12 class Framebuffer;
13 class CommandBuffer;
14 }
15
16 namespace Events {
17 struct BaseEvent;
18 }
19
21 public:
22 struct RenderMode {
23 const char* name = nullptr;
24 };
25
26 virtual ~BaseRenderer() {};
27 virtual bool OnWindowResize(Events::BaseEvent*) = 0;
28 virtual void Resize(uint32_t width, uint32_t height) = 0;
29 virtual void Render(
30 GraphicsAPI::CommandBuffer* commandBuffer,
31 entt::registry& registry,
32 glm::mat4 projectionMatrix,
33 glm::mat4 viewMatrix,
34 glm::vec3 eyePos,
35 Grindstone::GraphicsAPI::RenderAttachment& outAttachment // If nullptr, use default framebuffer
36 ) = 0;
37 virtual uint16_t GetRenderModeCount() const = 0;
38 virtual const RenderMode* GetRenderModes() const = 0;
39 virtual void SetRenderMode(uint16_t mode) = 0;
40 virtual std::vector<Grindstone::Rendering::GeometryRenderStats> GetRenderingStats() = 0;
41 };
42
44 public:
45 virtual Grindstone::BaseRenderer* CreateRenderer(GraphicsAPI::RenderPass* targetRenderPass) = 0;
46 virtual ~BaseRendererFactory() {}
47 };
48}
Definition BaseRenderer.hpp:43
Definition BaseRenderer.hpp:20
Definition CommandBuffer.hpp:90
Definition Framebuffer.hpp:16
Definition RenderPass.hpp:10
Definition BaseRenderer.hpp:22
Definition BaseEvent.hpp:7
Definition CommandBuffer.hpp:78