Lugdunum  0.1.0
Framebuffer.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
7 
8 namespace lug {
9 namespace Graphics {
10 namespace Vulkan {
11 namespace API {
12 
13 class Device;
14 class ImageView;
15 class RenderPass;
16 
17 namespace Builder {
18 
19 class Framebuffer {
20 public:
21  Framebuffer(const API::Device& device);
22 
23  Framebuffer(const Framebuffer&) = delete;
24  Framebuffer(Framebuffer&&) = delete;
25 
26  Framebuffer& operator=(const Framebuffer&) = delete;
27  Framebuffer& operator=(Framebuffer&&) = delete;
28 
29  ~Framebuffer() = default;
30 
31  // Setters
32  void setRenderPass(const API::RenderPass* renderPass);
33  void addAttachment(const API::ImageView* attachment);
34  void setWidth(uint32_t width);
35  void setHeight(uint32_t height);
36  void setLayers(uint32_t layers);
37 
38  // Build methods
39  bool build(API::Framebuffer& framebuffer, VkResult* returnResult = nullptr);
40  std::unique_ptr<API::Framebuffer> build(VkResult* returnResult = nullptr);
41 
42 private:
44 
45  const API::RenderPass* _renderPass{nullptr};
46  std::vector<const API::ImageView*> _attachments{};
47  uint32_t _width{0};
48  uint32_t _height{0};
49  uint32_t _layers{1};
50 };
51 
53 
54 } // Builder
55 } // API
56 } // Vulkan
57 } // Graphics
58 } // lug
bool build(API::Framebuffer &framebuffer, VkResult *returnResult=nullptr)
Definition: Framebuffer.cpp:17
std::vector< const API::ImageView * > _attachments
Definition: Framebuffer.hpp:46
void addAttachment(const API::ImageView *attachment)
Definition: Framebuffer.inl:5
Framebuffer & operator=(const Framebuffer &)=delete
void setRenderPass(const API::RenderPass *renderPass)
Definition: Framebuffer.inl:1