Lugdunum  0.1.0
Framebuffer.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace lug {
7 namespace Graphics {
8 namespace Vulkan {
9 namespace API {
10 
11 namespace Builder {
12 class Framebuffer;
13 } // Builder
14 
15 class Device;
16 
18  friend class Builder::Framebuffer;
19 
20 public:
21  // TODO: Declare offset and extent outside
22  struct Extent {
23  uint32_t width;
24  uint32_t height;
25  };
26 
27 public:
28  Framebuffer() = default;
29 
30  Framebuffer(const Framebuffer&) = delete;
32 
33  Framebuffer& operator=(const Framebuffer&) = delete;
34  Framebuffer& operator=(Framebuffer&& Framebuffer);
35 
36  ~Framebuffer();
37 
38  explicit operator VkFramebuffer() const {
39  return _framebuffer;
40  }
41 
42  const Extent& getExtent() const {
43  return _extent;
44  }
45 
46  void destroy();
47 
48 private:
49  explicit Framebuffer(VkFramebuffer Framebuffer, const Device* device, const Extent& extent);
50 
51 private:
52  VkFramebuffer _framebuffer{VK_NULL_HANDLE};
53  const Device* _device{nullptr};
54 
56 };
57 
58 } // API
59 } // Vulkan
60 } // Graphics
61 } // lug
#define LUG_GRAPHICS_API
Definition: Export.hpp:11