This commit is contained in:
Joshua Ashton 2023-01-18 08:53:40 +00:00
parent 5fcef94559
commit 1f17ee7fbb
1 changed files with 42 additions and 0 deletions

View File

@ -54,6 +54,48 @@ namespace orange
VkDeviceSize m_offset = 0u;
};
/*
template <typename T>
struct VkHandleDestructor
{
void destroy(T)
}
template <typename T>
class VkHandle
{
public:
VkHandle() { }
VkHandle(std::nullptr_t) { }
VkHandle(T handle)
: m_handle(handle) { }
~VkHandle()
{
}
T get() const { return m_handle; }
T* operator & () { return &m_handle; }
const T* operator & () const { return &m_handle; }
T operator -> () const { return m_handle; }
operator T() const { return m_handle; }
operator bool() const { return handle != VK_NULL_HANDLE; }
bool operator == (T other) const { return m_handle == other; }
bool operator != (T other) const { return m_handle != other; }
bool operator == (std::nullptr_t) const { return m_ptr == VK_NULL_HANDLE; }
bool operator != (std::nullptr_t) const { return m_ptr != VK_NULL_HANDLE; }
private:
T m_handle = VK_NULL_HANDLE;
};
*/
template <typename T>
using VulkanResult = Result<T, VkResult, VK_SUCCESS, VK_ERROR_UNKNOWN, VK_ERROR_UNKNOWN>;