Lugdunum  0.1.0
Framebuffer.cpp
Go to the documentation of this file.
2 
4 
5 namespace lug {
6 namespace Graphics {
7 namespace Vulkan {
8 namespace API {
9 
10 Framebuffer::Framebuffer(VkFramebuffer framebuffer, const Device* device, const Extent& extent) : _framebuffer(framebuffer), _device(device), _extent(extent) {}
11 
13  _framebuffer = framebuffer._framebuffer;
14  _device = framebuffer._device;
15  _extent = framebuffer._extent;
16  framebuffer._framebuffer = VK_NULL_HANDLE;
17  framebuffer._device = nullptr;
18  framebuffer._extent = {0, 0};
19 }
20 
22  destroy();
23 
24  _framebuffer = framebuffer._framebuffer;
25  _device = framebuffer._device;
26  _extent = framebuffer._extent;
27  framebuffer._framebuffer = VK_NULL_HANDLE;
28  framebuffer._device = nullptr;
29  framebuffer._extent = {0, 0};
30 
31  return *this;
32 }
33 
35  destroy();
36 }
37 
39  if (_framebuffer != VK_NULL_HANDLE) {
40  vkDestroyFramebuffer(static_cast<VkDevice>(*_device), _framebuffer, nullptr);
41  _framebuffer = VK_NULL_HANDLE;
42  }
43 }
44 
45 } // API
46 } // Vulkan
47 } // Graphics
48 } // lug
Framebuffer & operator=(const Framebuffer &)=delete