You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.2 KiB
57 lines
1.2 KiB
// Copyright 2022 Simon Boyé
|
|
#pragma once
|
|
|
|
#include <vk/forward.h>
|
|
#include <vk/Wrapper.h>
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
|
|
namespace vk {
|
|
|
|
|
|
class ImageView: public Wrapper {
|
|
public:
|
|
ImageView() noexcept;
|
|
ImageView(Context& context, const VkImageViewCreateInfo& create_info);
|
|
ImageView(const ImageView&) = default;
|
|
ImageView(ImageView&& other) noexcept;
|
|
~ImageView() noexcept;
|
|
|
|
ImageView& operator=(const ImageView&) = default;
|
|
ImageView& operator=(ImageView&& other) noexcept;
|
|
|
|
explicit inline operator bool() const noexcept {
|
|
return !is_null();
|
|
}
|
|
|
|
inline bool is_null() const noexcept {
|
|
return m_image_view == VK_NULL_HANDLE;
|
|
}
|
|
|
|
inline operator VkImageView() noexcept {
|
|
return m_image_view;
|
|
}
|
|
|
|
inline VkImageView image_view() noexcept {
|
|
return m_image_view;
|
|
}
|
|
|
|
inline void swap(ImageView& other) noexcept {
|
|
using std::swap;
|
|
Wrapper::swap(other);
|
|
swap(m_image_view, other.m_image_view);
|
|
}
|
|
|
|
friend inline void swap(ImageView& image_view_0, ImageView& image_view_1) noexcept {
|
|
image_view_0.swap(image_view_1);
|
|
}
|
|
|
|
void destroy() noexcept;
|
|
|
|
private:
|
|
VkImageView m_image_view = VK_NULL_HANDLE;
|
|
};
|
|
|
|
|
|
}
|
|
|