Remove ICloseable
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace OpenVulkano
|
|
||||||
{
|
|
||||||
class ICloseable
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~ICloseable() = default;
|
|
||||||
|
|
||||||
virtual void Close() = 0;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ITickable.hpp"
|
#include "ITickable.hpp"
|
||||||
#include "ICloseable.hpp"
|
|
||||||
#include "Version.hpp"
|
#include "Version.hpp"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -15,7 +14,7 @@ namespace OpenVulkano
|
|||||||
{
|
{
|
||||||
class IGraphicsAppManager;
|
class IGraphicsAppManager;
|
||||||
|
|
||||||
class IGraphicsApp : public ITickable, public ICloseable
|
class IGraphicsApp : public ITickable
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
IGraphicsAppManager* m_manager = nullptr;
|
IGraphicsAppManager* m_manager = nullptr;
|
||||||
@@ -25,6 +24,7 @@ namespace OpenVulkano
|
|||||||
|
|
||||||
virtual void Init() = 0;
|
virtual void Init() = 0;
|
||||||
virtual void InitPostGraphics() {}
|
virtual void InitPostGraphics() {}
|
||||||
|
virtual void Close() {}
|
||||||
virtual void CloseFinalize() {}
|
virtual void CloseFinalize() {}
|
||||||
[[nodiscard]] IGraphicsAppManager* GetGraphicsAppManager() const { return m_manager; }
|
[[nodiscard]] IGraphicsAppManager* GetGraphicsAppManager() const { return m_manager; }
|
||||||
void SetGraphicsAppManager(IGraphicsAppManager* manager) { m_manager = manager; }
|
void SetGraphicsAppManager(IGraphicsAppManager* manager) { m_manager = manager; }
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ITickable.hpp"
|
#include "ITickable.hpp"
|
||||||
#include "ICloseable.hpp"
|
|
||||||
#include "UI/IWindow.hpp"
|
#include "UI/IWindow.hpp"
|
||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
@@ -12,11 +11,11 @@ namespace OpenVulkano
|
|||||||
PlatformInitFailedException(char const* const message) : runtime_error(message) {}
|
PlatformInitFailedException(char const* const message) : runtime_error(message) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class IPlatform : public ITickable, public ICloseable
|
class IPlatform : public ITickable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void Init() = 0;
|
virtual void Init() = 0;
|
||||||
|
virtual void Close() = 0;
|
||||||
virtual IWindow* MakeWindow() = 0;
|
virtual IWindow* MakeWindow() = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#include "IResourceManager.hpp"
|
#include "IResourceManager.hpp"
|
||||||
#include "Base/ITickable.hpp"
|
#include "Base/ITickable.hpp"
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "Scene/Scene.hpp"
|
#include "Scene/Scene.hpp"
|
||||||
#include "Scene/UI/UI.hpp"
|
#include "Scene/UI/UI.hpp"
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -18,12 +17,13 @@ namespace OpenVulkano
|
|||||||
class IWindow;
|
class IWindow;
|
||||||
class IGraphicsAppManager;
|
class IGraphicsAppManager;
|
||||||
|
|
||||||
class IRenderer : public ITickable, public ICloseable
|
class IRenderer : public ITickable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~IRenderer() = default;
|
virtual ~IRenderer() = default;
|
||||||
|
|
||||||
virtual void Init(IGraphicsAppManager* graphicsAppManager, IWindow* window) = 0;
|
virtual void Init(IGraphicsAppManager* graphicsAppManager, IWindow* window) = 0;
|
||||||
|
virtual void Close() = 0;
|
||||||
|
|
||||||
virtual std::string GetMainRenderDeviceName() = 0;
|
virtual std::string GetMainRenderDeviceName() = 0;
|
||||||
virtual void Resize(uint32_t newWidth, uint32_t newHeight) = 0;
|
virtual void Resize(uint32_t newWidth, uint32_t newHeight) = 0;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#include "Math/Math.hpp"
|
#include "Math/Math.hpp"
|
||||||
#include "Base/PlatformEnums.hpp"
|
#include "Base/PlatformEnums.hpp"
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
@@ -36,12 +35,13 @@ namespace OpenVulkano
|
|||||||
bool resizeable = true;
|
bool resizeable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IWindow : public ICloseable
|
class IWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~IWindow() override = default;
|
virtual ~IWindow() = default;
|
||||||
|
|
||||||
virtual void Init(RenderAPI::RenderApi renderApi) = 0;
|
virtual void Init(RenderAPI::RenderApi renderApi) = 0;
|
||||||
|
virtual void Close() = 0;
|
||||||
|
|
||||||
virtual bool WindowHasBeenDestroyed() const = 0;
|
virtual bool WindowHasBeenDestroyed() const = 0;
|
||||||
virtual void SetWindowHasBeenDestroyed() = 0;
|
virtual void SetWindowHasBeenDestroyed() = 0;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ITickable.hpp"
|
#include "Base/ITickable.hpp"
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
{
|
{
|
||||||
@@ -16,7 +15,7 @@ namespace OpenVulkano
|
|||||||
class Camera;
|
class Camera;
|
||||||
}
|
}
|
||||||
|
|
||||||
class CameraController : public ITickable, ICloseable
|
class CameraController : public ITickable
|
||||||
{
|
{
|
||||||
Scene::Camera* m_camera;
|
Scene::Camera* m_camera;
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ namespace OpenVulkano
|
|||||||
|
|
||||||
virtual void Init(Scene::Camera* camera) { m_camera = camera; }
|
virtual void Init(Scene::Camera* camera) { m_camera = camera; }
|
||||||
|
|
||||||
void Close() override { m_camera = nullptr; }
|
virtual void Close() { m_camera = nullptr; }
|
||||||
|
|
||||||
void SetCamera(Scene::Camera* camera) { m_camera = camera; }
|
void SetCamera(Scene::Camera* camera) { m_camera = camera; }
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ITickable.hpp"
|
#include "Base/ITickable.hpp"
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "Base/IPlatform.hpp"
|
#include "Base/IPlatform.hpp"
|
||||||
#include "InputDeviceGLFW.hpp"
|
#include "InputDeviceGLFW.hpp"
|
||||||
#include <array>
|
#include <array>
|
||||||
@@ -18,7 +17,7 @@ namespace OpenVulkano
|
|||||||
{
|
{
|
||||||
class WindowGLFW;
|
class WindowGLFW;
|
||||||
|
|
||||||
class InputProviderGLFW final : public ITickable, public ICloseable
|
class InputProviderGLFW final : public ITickable
|
||||||
{
|
{
|
||||||
friend WindowGLFW;
|
friend WindowGLFW;
|
||||||
static InputProviderGLFW* INSTANCE;
|
static InputProviderGLFW* INSTANCE;
|
||||||
@@ -32,7 +31,7 @@ namespace OpenVulkano
|
|||||||
public:
|
public:
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
void Close() override;
|
virtual void Close();
|
||||||
|
|
||||||
void PreTick();
|
void PreTick();
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "InputKey.hpp"
|
#include "InputKey.hpp"
|
||||||
|
|
||||||
namespace OpenVulkano::Input
|
namespace OpenVulkano::Input
|
||||||
{
|
{
|
||||||
class InputDevice : public ICloseable
|
class InputDevice
|
||||||
{
|
{
|
||||||
InputDeviceType deviceType = InputDeviceType::UNKNOWN;
|
InputDeviceType deviceType = InputDeviceType::UNKNOWN;
|
||||||
int index = -1;
|
int index = -1;
|
||||||
@@ -38,11 +37,11 @@ namespace OpenVulkano::Input
|
|||||||
[[nodiscard]] virtual bool ReadButtonDown(int16_t key) const = 0;
|
[[nodiscard]] virtual bool ReadButtonDown(int16_t key) const = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~InputDevice() override = default;
|
virtual ~InputDevice() = default;
|
||||||
|
|
||||||
virtual void Tick() {}
|
virtual void Tick() {}
|
||||||
|
|
||||||
void Close() override
|
virtual void Close()
|
||||||
{
|
{
|
||||||
this->deviceType = InputDeviceType::UNKNOWN;
|
this->deviceType = InputDeviceType::UNKNOWN;
|
||||||
this->index = -1;
|
this->index = -1;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "Scene/IRayIntersectable.hpp"
|
#include "Scene/IRayIntersectable.hpp"
|
||||||
#include "DrawEncoder.hpp"
|
#include "DrawEncoder.hpp"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -27,7 +26,7 @@ namespace OpenVulkano::Scene
|
|||||||
BACKGROUND = 0, MAIN, TRANSPARENT, POST
|
BACKGROUND = 0, MAIN, TRANSPARENT, POST
|
||||||
};
|
};
|
||||||
|
|
||||||
class Drawable : public ICloseable, public IRayIntersectable
|
class Drawable : public IRayIntersectable
|
||||||
{
|
{
|
||||||
std::vector<Node*> m_nodes;
|
std::vector<Node*> m_nodes;
|
||||||
Scene* m_scene = nullptr;
|
Scene* m_scene = nullptr;
|
||||||
@@ -43,7 +42,7 @@ namespace OpenVulkano::Scene
|
|||||||
|
|
||||||
~Drawable() override {/* if (m_scene) Drawable::Close();*/ }
|
~Drawable() override {/* if (m_scene) Drawable::Close();*/ }
|
||||||
|
|
||||||
void Close() override;
|
virtual void Close();
|
||||||
|
|
||||||
void SetShader(Shader* shader) { m_shader = shader; }
|
void SetShader(Shader* shader) { m_shader = shader; }
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "Base/Render/RenderResource.hpp"
|
#include "Base/Render/RenderResource.hpp"
|
||||||
#include "Math/AABB.hpp"
|
#include "Math/AABB.hpp"
|
||||||
#include "Base/Utils.hpp"
|
#include "Base/Utils.hpp"
|
||||||
@@ -22,7 +21,7 @@ namespace OpenVulkano
|
|||||||
UINT16 = sizeof(uint16_t), UINT32 = sizeof(uint32_t)
|
UINT16 = sizeof(uint16_t), UINT32 = sizeof(uint32_t)
|
||||||
};
|
};
|
||||||
|
|
||||||
class Geometry : public RenderResourceHolder<Geometry>, public ICloseable
|
class Geometry : public RenderResourceHolder<Geometry>
|
||||||
{
|
{
|
||||||
friend class MeshLoader;
|
friend class MeshLoader;
|
||||||
public:
|
public:
|
||||||
@@ -51,7 +50,7 @@ namespace OpenVulkano
|
|||||||
|
|
||||||
void SetIndices(const uint32_t* data, uint32_t size, uint32_t dstOffset = 0) const;
|
void SetIndices(const uint32_t* data, uint32_t size, uint32_t dstOffset = 0) const;
|
||||||
|
|
||||||
void Close() override;
|
virtual void Close();
|
||||||
|
|
||||||
void Free();
|
void Free();
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "Base/Render/RenderResource.hpp"
|
#include "Base/Render/RenderResource.hpp"
|
||||||
#include "Math/Math.hpp"
|
#include "Math/Math.hpp"
|
||||||
#include "Math/Pose.hpp"
|
#include "Math/Pose.hpp"
|
||||||
@@ -20,7 +19,7 @@ namespace OpenVulkano::Scene
|
|||||||
{
|
{
|
||||||
class Scene;
|
class Scene;
|
||||||
|
|
||||||
class Node : public RenderResourceHolder<Node>, public ICloseable
|
class Node : public RenderResourceHolder<Node>
|
||||||
{
|
{
|
||||||
friend Scene;
|
friend Scene;
|
||||||
|
|
||||||
@@ -41,11 +40,11 @@ namespace OpenVulkano::Scene
|
|||||||
|
|
||||||
Node(const Math::Matrix4f& pose);
|
Node(const Math::Matrix4f& pose);
|
||||||
|
|
||||||
~Node() noexcept override;
|
virtual ~Node() noexcept;
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
void Close() override;
|
virtual void Close();
|
||||||
|
|
||||||
void AddChild(Node* node);
|
void AddChild(Node* node);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace OpenVulkano
|
|||||||
{
|
{
|
||||||
namespace Scene
|
namespace Scene
|
||||||
{
|
{
|
||||||
class Scene : public ICloseable
|
class Scene
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Node* root;
|
Node* root;
|
||||||
@@ -46,7 +46,7 @@ namespace OpenVulkano
|
|||||||
this->root = root;
|
this->root = root;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close() override
|
virtual void Close()
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "Base/Utils.hpp"
|
#include "Base/Utils.hpp"
|
||||||
#include "Base/Render/RenderResource.hpp"
|
#include "Base/Render/RenderResource.hpp"
|
||||||
#include "VertexInputDescription.hpp"
|
#include "VertexInputDescription.hpp"
|
||||||
@@ -81,7 +80,7 @@ namespace OpenVulkano::Scene
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Shader final : public RenderResourceHolder<Shader>, public ICloseable
|
class Shader final : public RenderResourceHolder<Shader>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::vector<ShaderProgram> shaderPrograms{};
|
std::vector<ShaderProgram> shaderPrograms{};
|
||||||
@@ -99,7 +98,7 @@ namespace OpenVulkano::Scene
|
|||||||
float depthBiasClamp = 0.0f, depthBiasSlope = 0.0f, depthBiasConstant = 0.0f;
|
float depthBiasClamp = 0.0f, depthBiasSlope = 0.0f, depthBiasConstant = 0.0f;
|
||||||
|
|
||||||
Shader() = default;
|
Shader() = default;
|
||||||
~Shader() override { Shader::Close(); }
|
~Shader() { Shader::Close(); }
|
||||||
|
|
||||||
Shader& AddShaderProgram(const ShaderProgram& shaderProgram)
|
Shader& AddShaderProgram(const ShaderProgram& shaderProgram)
|
||||||
{
|
{
|
||||||
@@ -173,7 +172,7 @@ namespace OpenVulkano::Scene
|
|||||||
depthBiasConstant = constant;
|
depthBiasConstant = constant;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close() override
|
void Close()
|
||||||
{
|
{
|
||||||
if (HasRenderResource())
|
if (HasRenderResource())
|
||||||
GetRenderResource().Release();
|
GetRenderResource().Release();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "Device.hpp"
|
#include "Device.hpp"
|
||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
@@ -9,7 +9,7 @@ namespace OpenVulkano
|
|||||||
/**
|
/**
|
||||||
* \brief A not managed buffer. This should be used rarely.
|
* \brief A not managed buffer. This should be used rarely.
|
||||||
*/
|
*/
|
||||||
struct Buffer : public ICloseable
|
struct Buffer
|
||||||
{
|
{
|
||||||
vk::Device device;
|
vk::Device device;
|
||||||
vk::DeviceMemory memory;
|
vk::DeviceMemory memory;
|
||||||
@@ -94,7 +94,7 @@ namespace OpenVulkano
|
|||||||
device.invalidateMappedMemoryRanges(vk::MappedMemoryRange(memory, offset, size));
|
device.invalidateMappedMemoryRanges(vk::MappedMemoryRange(memory, offset, size));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close() override
|
void Close()
|
||||||
{
|
{
|
||||||
if (mapped) UnMap();
|
if (mapped) UnMap();
|
||||||
if(memory)
|
if(memory)
|
||||||
|
|||||||
@@ -6,14 +6,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include <vulkan/vulkan.hpp>
|
#include <vulkan/vulkan.hpp>
|
||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
{
|
{
|
||||||
namespace Vulkan
|
namespace Vulkan
|
||||||
{
|
{
|
||||||
struct CommandHelper : virtual ICloseable
|
struct CommandHelper final
|
||||||
{
|
{
|
||||||
vk::Device device;
|
vk::Device device;
|
||||||
vk::CommandPool cmdPool;
|
vk::CommandPool cmdPool;
|
||||||
@@ -42,7 +41,7 @@ namespace OpenVulkano
|
|||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close() override
|
void Close()
|
||||||
{
|
{
|
||||||
device.freeCommandBuffers(cmdPool, 1, &cmdBuffer);
|
device.freeCommandBuffers(cmdPool, 1, &cmdBuffer);
|
||||||
device.destroyCommandPool(cmdPool);
|
device.destroyCommandPool(cmdPool);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace OpenVulkano
|
|||||||
{
|
{
|
||||||
class Device;
|
class Device;
|
||||||
|
|
||||||
class Context final : public ICloseable
|
class Context final
|
||||||
{
|
{
|
||||||
bool enableValidationLayer, initialized;
|
bool enableValidationLayer, initialized;
|
||||||
std::set<std::string> requiredExtensions;
|
std::set<std::string> requiredExtensions;
|
||||||
@@ -45,14 +45,14 @@ namespace OpenVulkano
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
~Context() override
|
~Context()
|
||||||
{
|
{
|
||||||
if (initialized) Close();
|
if (initialized) Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Init(IGraphicsAppManager* graphicsAppManager, IVulkanWindow* window);
|
void Init(IGraphicsAppManager* graphicsAppManager, IVulkanWindow* window);
|
||||||
|
|
||||||
void Close() override;
|
void Close();
|
||||||
|
|
||||||
void Resize(uint32_t newWidth, uint32_t newHeight);
|
void Resize(uint32_t newWidth, uint32_t newHeight);
|
||||||
|
|
||||||
|
|||||||
@@ -10,13 +10,12 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
{
|
{
|
||||||
namespace Vulkan
|
namespace Vulkan
|
||||||
{
|
{
|
||||||
class Device : public ICloseable
|
class Device final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
vk::PhysicalDevice physicalDevice;
|
vk::PhysicalDevice physicalDevice;
|
||||||
@@ -106,7 +105,7 @@ namespace OpenVulkano
|
|||||||
return memoryProperties.memoryTypes[memoryType].propertyFlags;
|
return memoryProperties.memoryTypes[memoryType].propertyFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close() override;
|
void Close();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "Image.hpp"
|
#include "Image.hpp"
|
||||||
#include "Device.hpp"
|
#include "Device.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -17,7 +16,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
{
|
{
|
||||||
class RenderPass;
|
class RenderPass;
|
||||||
|
|
||||||
class FrameBuffer : ICloseable
|
class FrameBuffer
|
||||||
{
|
{
|
||||||
Image depthBuffer;
|
Image depthBuffer;
|
||||||
std::vector<vk::Framebuffer> frameBuffers;
|
std::vector<vk::Framebuffer> frameBuffers;
|
||||||
@@ -50,7 +49,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
protected:
|
protected:
|
||||||
void Resize(vk::Extent3D size);
|
void Resize(vk::Extent3D size);
|
||||||
|
|
||||||
void Close() override
|
virtual void Close()
|
||||||
{
|
{
|
||||||
DestroyFrameBuffer();
|
DestroyFrameBuffer();
|
||||||
if(depthBuffer) depthBuffer.Close();
|
if(depthBuffer) depthBuffer.Close();
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
SetLayout(cmdBuffer, vk::ImageSubresourceRange(aspectMask, 0, 1, 0, 1), newLayout, oldLayout);
|
SetLayout(cmdBuffer, vk::ImageSubresourceRange(aspectMask, 0, 1, 0, 1), newLayout, oldLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close() override;
|
virtual void Close();
|
||||||
|
|
||||||
operator bool() const { return image.operator bool(); }
|
operator bool() const { return image.operator bool(); }
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "MetalBackedTexture.h"
|
#include "MetalBackedTexture.h"
|
||||||
|
|
||||||
#import <CoreVideo/CVPixelBuffer.h>
|
#import <CoreVideo/CVPixelBuffer.h>
|
||||||
@@ -16,7 +15,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
{
|
{
|
||||||
class Renderer;
|
class Renderer;
|
||||||
|
|
||||||
class MetalTextureCache : public ICloseable
|
class MetalTextureCache final
|
||||||
{
|
{
|
||||||
CVMetalTextureCacheRef m_textureCache = nullptr;
|
CVMetalTextureCacheRef m_textureCache = nullptr;
|
||||||
Vulkan::ResourceManager* m_resourceManager = nullptr;
|
Vulkan::ResourceManager* m_resourceManager = nullptr;
|
||||||
@@ -28,7 +27,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
|
|
||||||
void Init(IRenderer* renderer);
|
void Init(IRenderer* renderer);
|
||||||
|
|
||||||
void Close() override;
|
void Close();
|
||||||
|
|
||||||
Scene::Texture* Get(CVPixelBufferRef pixelBuffer, MTLPixelFormat pixelFormat);
|
Scene::Texture* Get(CVPixelBufferRef pixelBuffer, MTLPixelFormat pixelFormat);
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
{
|
{
|
||||||
class FrameBuffer;
|
class FrameBuffer;
|
||||||
|
|
||||||
class RenderPass : public ICloseable
|
class RenderPass
|
||||||
{ //TODO allow to control the render rect size
|
{ //TODO allow to control the render rect size
|
||||||
protected:
|
protected:
|
||||||
vk::Device m_device;
|
vk::Device m_device;
|
||||||
@@ -27,14 +27,14 @@ namespace OpenVulkano::Vulkan
|
|||||||
|
|
||||||
RenderPass() = default;
|
RenderPass() = default;
|
||||||
|
|
||||||
~RenderPass() override
|
virtual ~RenderPass()
|
||||||
{
|
{
|
||||||
if (m_frameBuffer) RenderPass::Close();
|
if (m_frameBuffer) RenderPass::Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Init(Device* device, FrameBuffer* frameBuffer, bool clearColor = false, bool clearDepth = false);
|
void Init(Device* device, FrameBuffer* frameBuffer, bool clearColor = false, bool clearDepth = false);
|
||||||
|
|
||||||
void Close() override;
|
virtual void Close();
|
||||||
|
|
||||||
void SetClearColor(vk::ClearColorValue clearColor = vk::ClearColorValue(std::array<float, 4>{ 0.39f, 0.58f, 0.93f, 1.0f }))
|
void SetClearColor(vk::ClearColorValue clearColor = vk::ClearColorValue(std::array<float, 4>{ 0.39f, 0.58f, 0.93f, 1.0f }))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/ICloseable.hpp"
|
|
||||||
#include "Vulkan/Resources/ManagedBuffer.hpp"
|
#include "Vulkan/Resources/ManagedBuffer.hpp"
|
||||||
#include "Vulkan/Scene/IRecordable.hpp"
|
#include "Vulkan/Scene/IRecordable.hpp"
|
||||||
|
|
||||||
@@ -14,7 +13,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
{
|
{
|
||||||
class ManagedBuffer;
|
class ManagedBuffer;
|
||||||
|
|
||||||
class UniformBuffer final : public IRecordable, public ICloseable
|
class UniformBuffer final : public IRecordable
|
||||||
{
|
{
|
||||||
ManagedBuffer::Ptr m_buffer = nullptr;
|
ManagedBuffer::Ptr m_buffer = nullptr;
|
||||||
vk::DescriptorSet m_descriptorSet;
|
vk::DescriptorSet m_descriptorSet;
|
||||||
@@ -30,7 +29,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
|
|
||||||
void Init(ManagedBuffer::Ptr buffer, uint32_t frameOffset, uint32_t frameSize, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding, uint32_t setId);
|
void Init(ManagedBuffer::Ptr buffer, uint32_t frameOffset, uint32_t frameSize, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding, uint32_t setId);
|
||||||
|
|
||||||
void Close() override;
|
virtual void Close();
|
||||||
|
|
||||||
void Record(VulkanDrawContext* drawContext) override;
|
void Record(VulkanDrawContext* drawContext) override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user