*
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include <IntrusivePtr.h>
|
||||
#include <VulkanPP/VulkanFunctions.hpp>
|
||||
|
||||
namespace VulkanPP {
|
||||
class PhysicalDevice;
|
||||
|
||||
|
||||
|
||||
// === Lifetime summary (deterministic) ===
|
||||
// Handle: VkDisplayKHR
|
||||
// Holds (destroy/free owners + creation parent, or producer parent): PhysicalDevice
|
||||
// Keeps (from *CreateInfo/*AllocateInfo): —
|
||||
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
|
||||
|
||||
class DisplayKHR : public RefCounted {
|
||||
public:
|
||||
VkDisplayKHR getHandle() const noexcept { return _handle; }
|
||||
IntrusivePtr<PhysicalDevice> getPhysicalDevice() const noexcept { return _owner0; }
|
||||
public:
|
||||
static IntrusivePtr<DisplayKHR> fromHandle(IntrusivePtr<PhysicalDevice> owner0, VkDisplayKHR handle) {
|
||||
return IntrusivePtr<DisplayKHR>(new DisplayKHR(owner0, handle, false));
|
||||
}
|
||||
private:
|
||||
explicit DisplayKHR(IntrusivePtr<PhysicalDevice> owner0, VkDisplayKHR handle, bool owned);
|
||||
~DisplayKHR() override;
|
||||
private:
|
||||
VkDisplayKHR _handle{VK_NULL_HANDLE};
|
||||
bool _owned{false};
|
||||
IntrusivePtr<PhysicalDevice> _owner0;
|
||||
};
|
||||
using PDisplayKHR = IntrusivePtr<DisplayKHR>;
|
||||
|
||||
} // namespace VulkanPP
|
||||
Reference in New Issue
Block a user