Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
VulkanFramebuffer.hpp
1#pragma once
2
3#include <string>
4#include <vector>
5#include <stdint.h>
6
7#include <Common/Graphics/Framebuffer.hpp>
8#include <Common/Graphics/Formats.hpp>
9#include <vulkan/vulkan.h>
10
11namespace Grindstone::GraphicsAPI::Vulkan {
12 class RenderPass;
13 class RenderTarget;
14 class DepthStencilTarget;
15
17 public:
19 RenderPass* renderPass,
20 VkFramebuffer framebuffer,
21 uint32_t width,
22 uint32_t height,
23 const char* debugName
24 );
25 Framebuffer(const CreateInfo& createInfo);
26 virtual ~Framebuffer() override;
27 void UpdateNativeFramebuffer(
28 RenderPass* renderPass,
29 VkFramebuffer framebuffer,
30 uint32_t width,
31 uint32_t height
32 );
33 public:
34 VkFramebuffer GetFramebuffer() const;
35 public:
36 virtual uint32_t GetAttachment(uint32_t attachmentIndex) override;
37 virtual Grindstone::GraphicsAPI::RenderPass* GetRenderPass() const override;
38 virtual void Resize(uint32_t width, uint32_t height) override;
39 virtual void Clear(ClearMode mask) override;
40 virtual void BindTextures(int i) override;
41 virtual void Bind() override;
42 virtual void BindWrite() override;
43 virtual void BindRead() override;
44 virtual void Unbind() override;
45 virtual uint32_t GetWidth() const override;
46 virtual uint32_t GetHeight() const override;
47 virtual uint32_t GetRenderTargetCount() const override;
48 virtual Grindstone::GraphicsAPI::RenderTarget* GetRenderTarget(uint32_t index) const override;
49 virtual Grindstone::GraphicsAPI::DepthStencilTarget* GetDepthStencilTarget() const override;
50 private:
51 void Create();
52 void Cleanup();
53
54 std::string debugName;
55 std::vector<RenderTarget*> colorAttachments;
56 DepthStencilTarget* depthAttachment = nullptr;
57
58 VkFramebuffer framebuffer = nullptr;
59 GraphicsAPI::RenderPass* renderPass = nullptr;
60 bool isCubemap = false;
61
62 uint32_t width = 0;
63 uint32_t height = 0;
64 };
65}
Definition DepthStencilTarget.hpp:15
Definition Framebuffer.hpp:19
Definition RenderPass.hpp:27
Definition RenderTarget.hpp:12
Definition VulkanDepthStencilTarget.hpp:9
Definition VulkanFramebuffer.hpp:16
Definition VulkanRenderPass.hpp:10