Former-commit-id: 849e76f479aaf77646ae786584ac896838cc2f63 [formerly fcbd8bd667d6cfac01e01241bea06c43d34a1ad0] [formerly e042ac243512c07e9870213ec7d5a0e9ff7a4ba2 [formerly 378029f40ef5dee44eb29a73e3d39639bd91cee6]] Former-commit-id: c284ca126ded4435adbe15ca2a3e619fa2e09e1a [formerly 69da980659df0005066ef6b21a181359d28b184b] Former-commit-id: a989d3a678fd4c0ce1c23f54c5f3fda5fb175e2e
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
// Copyright (C) 2016 Jérôme Leclercq
|
|
// This file is part of the "Nazara Engine - Vulkan Renderer"
|
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
|
|
#pragma once
|
|
|
|
#ifndef NAZARA_VULKANRENDERER_VKDEVICEOBJECT_HPP
|
|
#define NAZARA_VULKANRENDERER_VKDEVICEOBJECT_HPP
|
|
|
|
#include <Nazara/Prerequesites.hpp>
|
|
#include <Nazara/VulkanRenderer/VkDevice.hpp>
|
|
#include <vulkan/vulkan.h>
|
|
|
|
namespace Nz
|
|
{
|
|
namespace Vk
|
|
{
|
|
template<typename C, typename VkType, typename CreateInfo>
|
|
class DeviceObject
|
|
{
|
|
public:
|
|
inline DeviceObject();
|
|
DeviceObject(const DeviceObject&) = delete;
|
|
inline DeviceObject(DeviceObject&& object);
|
|
inline ~DeviceObject();
|
|
|
|
inline bool Create(const DeviceHandle& device, const CreateInfo& createInfo, const VkAllocationCallbacks* allocator = nullptr);
|
|
inline void Destroy();
|
|
|
|
inline bool IsValid() const;
|
|
|
|
inline const DeviceHandle& GetDevice() const;
|
|
inline VkResult GetLastErrorCode() const;
|
|
|
|
DeviceObject& operator=(const DeviceObject&) = delete;
|
|
DeviceObject& operator=(DeviceObject&&) = delete;
|
|
|
|
inline operator VkType() const;
|
|
|
|
protected:
|
|
DeviceHandle m_device;
|
|
VkAllocationCallbacks m_allocator;
|
|
VkType m_handle;
|
|
mutable VkResult m_lastErrorCode;
|
|
};
|
|
}
|
|
}
|
|
|
|
#include <Nazara/VulkanRenderer/VkDeviceObject.inl>
|
|
|
|
#endif // NAZARA_VULKANRENDERER_VKDEVICEOBJECT_HPP
|