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