Lugdunum  0.1.0
ImageView.cpp
Go to the documentation of this file.
2 
4 
5 namespace lug {
6 namespace Graphics {
7 namespace Vulkan {
8 namespace API {
9 
10 ImageView::ImageView(VkImageView imageView, const Device* device, const Image* image) : _imageView(imageView), _device(device), _image(image) {}
11 
13  _imageView = imageView._imageView;
14  _device = imageView._device;
15  _image = imageView._image;
16  imageView._imageView = VK_NULL_HANDLE;
17  imageView._device = nullptr;
18  imageView._image = nullptr;
19 }
20 
22  destroy();
23 
24  _imageView = imageView._imageView;
25  _device = imageView._device;
26  _image = imageView._image;
27  imageView._imageView = VK_NULL_HANDLE;
28  imageView._device = nullptr;
29  imageView._image = nullptr;
30 
31  return *this;
32 }
33 
35  destroy();
36 }
37 
39  if (_imageView != VK_NULL_HANDLE) {
40  vkDestroyImageView(static_cast<VkDevice>(*_device), _imageView, nullptr);
41  _imageView = VK_NULL_HANDLE;
42  _device = nullptr;
43  _image = nullptr;
44  }
45 }
46 
47 } // API
48 } // Vulkan
49 } // Graphics
50 } // lug
ImageView & operator=(const ImageView &)=delete