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
8namespace Grindstone {
9 namespace GraphicsAPI {
10 class RenderPass;
11 class Framebuffer;
12 class CommandBuffer;
13 }
14
15 namespace Events {
16 struct BaseEvent;
17 }
18
20 public:
21 struct RenderMode {
22 const char* name = nullptr;
23 };
24
25 virtual ~BaseRenderer() {};
26 virtual bool OnWindowResize(Events::BaseEvent*) = 0;
27 virtual void Resize(uint32_t width, uint32_t height) = 0;
28 virtual void Render(
29 GraphicsAPI::CommandBuffer* commandBuffer,
30 entt::registry& registry,
31 glm::mat4 projectionMatrix,
32 glm::mat4 viewMatrix,
33 glm::vec3 eyePos,
34 GraphicsAPI::Framebuffer* outputFramebuffer = nullptr // If nullptr, use default framebuffer
35 ) = 0;
36 virtual uint16_t GetRenderModeCount() const = 0;
37 virtual const RenderMode* GetRenderModes() const = 0;
38 virtual void SetRenderMode(uint16_t mode) = 0;
39 virtual std::vector<Grindstone::Rendering::GeometryRenderStats> GetRenderingStats() = 0;
40 };
41
43 public:
44 virtual Grindstone::BaseRenderer* CreateRenderer(GraphicsAPI::RenderPass* targetRenderPass) = 0;
45 virtual ~BaseRendererFactory() {}
46 };
47}
Definition BaseRenderer.hpp:42
Definition BaseRenderer.hpp:19
Definition CommandBuffer.hpp:73
Definition Framebuffer.hpp:16
Definition RenderPass.hpp:27
Definition BaseRenderer.hpp:21
Definition BaseEvent.hpp:7