mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
parent
91a57a6ecf
commit
1dafad9375
@ -936,15 +936,17 @@ namespace vk
|
|||||||
std::function<void(T object)> delete_func;
|
std::function<void(T object)> delete_func;
|
||||||
|
|
||||||
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
|
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
|
||||||
bool released = false;
|
bool released = false, auto_release_copies = false;
|
||||||
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
|
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
|
||||||
|
|
||||||
using INS = vk::Instance; using DEV = vk::Device;
|
using INS = vk::Instance; using DEV = vk::Device;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
scoped_handle(const scoped_handle<T>& s) {
|
scoped_handle(const scoped_handle<T>& s) {
|
||||||
|
std::cout << "copy constructor" << std::endl;
|
||||||
this->object = s.object;
|
this->object = s.object;
|
||||||
this->delete_func = s.delete_func;
|
this->delete_func = s.delete_func;
|
||||||
|
this->released = s.auto_release_copies;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Fnc, typename alloc>
|
template<typename Fnc, typename alloc>
|
||||||
@ -1054,11 +1056,12 @@ namespace vk
|
|||||||
}
|
}
|
||||||
|
|
||||||
void destroy() {
|
void destroy() {
|
||||||
if(released){
|
if (this->object && released) {
|
||||||
if (this->object)
|
std::cout << "Deleting object of type " << typeid(object).name() << std::endl;
|
||||||
this->delete_func(this->object);
|
this->delete_func(this->object);
|
||||||
this->object = VK_NULL_HANDLE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->object = VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
bool isEmpty() {
|
bool isEmpty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user