Lugdunum  0.1.0
Surface.cpp
Go to the documentation of this file.
2 
4 
5 namespace lug {
6 namespace Graphics {
7 namespace Vulkan {
8 namespace API {
9 
10 Surface::Surface(VkSurfaceKHR surface, const Instance* instance) : _surface(surface), _instance(instance) {}
11 
13  _surface = surface._surface;
14  _instance = surface._instance;
15  surface._surface = VK_NULL_HANDLE;
16  surface._instance = nullptr;
17 }
18 
20  destroy();
21 
22  _surface = surface._surface;
23  _instance = surface._instance;
24  surface._surface = VK_NULL_HANDLE;
25  surface._instance = nullptr;
26 
27  return *this;
28 }
29 
31  destroy();
32 }
33 
35  if (_surface != VK_NULL_HANDLE) {
36  vkDestroySurfaceKHR(static_cast<VkInstance>(*_instance), _surface, nullptr);
37  _surface = VK_NULL_HANDLE;
38  }
39 }
40 
41 } // API
42 } // Vulkan
43 } // Graphics
44 } // lug
Surface & operator=(const Surface &)=delete