Lugdunum
0.1.0
src
lug
Graphics
Vulkan
API
Sampler.cpp
Go to the documentation of this file.
1
#include <
lug/Graphics/Vulkan/API/Sampler.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
Sampler::Sampler
(VkSampler sampler,
const
Device
* device) : _sampler(sampler), _device(device) {}
11
12
Sampler::Sampler
(
Sampler
&& sampler) {
13
_sampler
= sampler._sampler;
14
_device
= sampler.
_device
;
15
sampler._sampler = VK_NULL_HANDLE;
16
sampler._device =
nullptr
;
17
}
18
19
Sampler
&
Sampler::operator=
(
Sampler
&& sampler) {
20
destroy
();
21
22
_sampler
= sampler._sampler;
23
_device
= sampler.
_device
;
24
sampler._sampler = VK_NULL_HANDLE;
25
sampler._device =
nullptr
;
26
27
return
*
this
;
28
}
29
30
Sampler::~Sampler
() {
31
destroy
();
32
}
33
34
void
Sampler::destroy
() {
35
if
(
_sampler
!= VK_NULL_HANDLE) {
36
vkDestroySampler(static_cast<VkDevice>(*
_device
),
_sampler
,
nullptr
);
37
_sampler
= VK_NULL_HANDLE;
38
}
39
}
40
41
}
// API
42
}
// Vulkan
43
}
// Graphics
44
}
// lug
lug::Graphics::Vulkan::API::Sampler::destroy
void destroy()
Definition:
Sampler.cpp:34
Device.hpp
lug::Graphics::Vulkan::API::Sampler::_device
const Device * _device
Definition:
Sampler.hpp:42
Vulkan
Definition:
Vulkan.hpp:155
lug::Graphics::Vulkan::API::Sampler::operator=
Sampler & operator=(const Sampler &)=delete
lug::Graphics::Vulkan::API::Device
Definition:
Device.hpp:16
Sampler.hpp
lug
Definition:
Application.hpp:11
lug::Graphics::Vulkan::API::Device::_device
VkDevice _device
Definition:
Device.hpp:55
lug::Graphics::Vulkan::API::Sampler::Sampler
Sampler()=default
lug::Graphics::Vulkan::API::Sampler
Definition:
Sampler.hpp:17
lug::Graphics::Vulkan::API::Sampler::~Sampler
~Sampler()
Definition:
Sampler.cpp:30
lug::Graphics::Vulkan::API::Sampler::_sampler
VkSampler _sampler
Definition:
Sampler.hpp:41
Generated by
1.8.13