Lugdunum
0.1.0
src
lug
Graphics
Vulkan
API
Semaphore.cpp
Go to the documentation of this file.
1
#include <
lug/Graphics/Vulkan/API/Semaphore.hpp
>
2
3
#include <
lug/Graphics/Vulkan/API/Device.hpp
>
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
12
Semaphore::Semaphore
(
Semaphore
&& semaphore) {
13
_semaphore
= semaphore._semaphore;
14
_device
= semaphore.
_device
;
15
semaphore._semaphore = VK_NULL_HANDLE;
16
semaphore._device =
nullptr
;
17
}
18
19
Semaphore
&
Semaphore::operator=
(
Semaphore
&& semaphore) {
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
30
Semaphore::~Semaphore
() {
31
destroy
();
32
}
33
34
void
Semaphore::destroy
() {
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
lug::Graphics::Vulkan::API::Semaphore::_device
const Device * _device
Definition:
Semaphore.hpp:42
lug::Graphics::Vulkan::API::Semaphore::Semaphore
Semaphore()=default
lug::Graphics::Vulkan::API::Semaphore::_semaphore
VkSemaphore _semaphore
Definition:
Semaphore.hpp:41
Device.hpp
Semaphore.hpp
Vulkan
Definition:
Vulkan.hpp:155
lug::Graphics::Vulkan::API::Semaphore::operator=
Semaphore & operator=(const Semaphore &)=delete
lug::Graphics::Vulkan::API::Device
Definition:
Device.hpp:16
lug::Graphics::Vulkan::API::Semaphore
Definition:
Semaphore.hpp:17
lug
Definition:
Application.hpp:11
lug::Graphics::Vulkan::API::Device::_device
VkDevice _device
Definition:
Device.hpp:55
lug::Graphics::Vulkan::API::Semaphore::destroy
void destroy()
Definition:
Semaphore.cpp:34
lug::Graphics::Vulkan::API::Semaphore::~Semaphore
~Semaphore()
Definition:
Semaphore.cpp:30
Generated by
1.8.13