Lugdunum  0.1.0
Sampler.cpp
Go to the documentation of this file.
2 
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 
13  _sampler = sampler._sampler;
14  _device = sampler._device;
15  sampler._sampler = VK_NULL_HANDLE;
16  sampler._device = nullptr;
17 }
18 
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 
31  destroy();
32 }
33 
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
Sampler & operator=(const Sampler &)=delete