mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-12 23:23:34 +00:00
working
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* vk_framebuffer.h :+: :+: :+: */
|
||||
/* FrameBuffer.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/06 18:19:44 by maldavid #+# #+# */
|
||||
/* Updated: 2024/03/25 19:08:37 by maldavid ### ########.fr */
|
||||
/* Updated: 2024/03/28 22:16:02 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -18,18 +18,18 @@ namespace mlx
|
||||
class FrameBuffer
|
||||
{
|
||||
public:
|
||||
void init(class RenderPass& renderpass, class Image& image);
|
||||
void destroy() noexcept;
|
||||
void Init(class RenderPass& renderpass, class Image& image);
|
||||
void Destroy() noexcept;
|
||||
|
||||
inline VkFramebuffer& operator()() noexcept { return _framebuffer; }
|
||||
inline VkFramebuffer& get() noexcept { return _framebuffer; }
|
||||
inline std::uint32_t getWidth() const noexcept { return _width; }
|
||||
inline std::uint32_t getHeight() const noexcept { return _height; }
|
||||
inline VkFramebuffer& operator()() noexcept { return m_framebuffer; }
|
||||
inline VkFramebuffer& Get() noexcept { return m_framebuffer; }
|
||||
inline std::uint32_t GetWidth() const noexcept { return m_width; }
|
||||
inline std::uint32_t GetHeight() const noexcept { return m_height; }
|
||||
|
||||
private:
|
||||
VkFramebuffer _framebuffer = VK_NULL_HANDLE;
|
||||
std::uint32_t _width = 0;
|
||||
std::uint32_t _height = 0;
|
||||
VkFramebuffer m_framebuffer = VK_NULL_HANDLE;
|
||||
std::uint32_t m_width = 0;
|
||||
std::uint32_t m_height = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* vk_render_pass.h :+: :+: :+: */
|
||||
/* RenderPass.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/06 18:22:00 by maldavid #+# #+# */
|
||||
/* Updated: 2024/03/25 19:08:30 by maldavid ### ########.fr */
|
||||
/* Updated: 2024/03/28 22:16:44 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -18,18 +18,18 @@ namespace mlx
|
||||
class RenderPass
|
||||
{
|
||||
public:
|
||||
void init(VkFormat attachement_format, VkImageLayout layout);
|
||||
void destroy() noexcept;
|
||||
void Init(VkFormat attachement_format, VkImageLayout layout);
|
||||
void Destroy() noexcept;
|
||||
|
||||
void begin(class CmdBuffer& cmd, class FrameBuffer& fb);
|
||||
void end(class CmdBuffer& cmd);
|
||||
void Begin(class CmommandBuffer& cmd, class FrameBuffer& fb);
|
||||
void End(class CommandBuffer& cmd);
|
||||
|
||||
inline VkRenderPass& operator()() noexcept { return _render_pass; }
|
||||
inline VkRenderPass& get() noexcept { return _render_pass; }
|
||||
inline VkRenderPass& operator()() noexcept { return m_render_pass; }
|
||||
inline VkRenderPass& Get() noexcept { return m_render_pass; }
|
||||
|
||||
private:
|
||||
VkRenderPass _render_pass = VK_NULL_HANDLE;
|
||||
bool _is_running = false;
|
||||
VkRenderPass m_render_pass = VK_NULL_HANDLE;
|
||||
bool m_is_running = false;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* vk_swapchain.h :+: :+: :+: */
|
||||
/* Swapchain.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/06 18:23:27 by maldavid #+# #+# */
|
||||
/* Updated: 2024/03/25 19:08:26 by maldavid ### ########.fr */
|
||||
/* Updated: 2024/03/28 22:18:15 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef __MLX_VK_SWAPCHAIN__
|
||||
#define __MLX_VK_SWAPCHAIN__
|
||||
|
||||
#include <renderer/images/vk_image.h>
|
||||
#include <Renderer/Images/Image.h>
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
@@ -34,31 +34,31 @@ namespace mlx
|
||||
public:
|
||||
SwapChain() = default;
|
||||
|
||||
void init(class Renderer* renderer);
|
||||
void recreate();
|
||||
void destroy() noexcept;
|
||||
void Init(NonOwningPtr<class Renderer> renderer);
|
||||
void Recreate();
|
||||
void Destroy() noexcept;
|
||||
|
||||
SwapChainSupportDetails querySwapChainSupport(VkPhysicalDevice device);
|
||||
VkExtent2D chooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities);
|
||||
VkPresentModeKHR chooseSwapPresentMode([[maybe_unused]] const std::vector<VkPresentModeKHR> &availablePresentModes);
|
||||
SwapChainSupportDetails QuerySwapChainSupport(VkPhysicalDevice device);
|
||||
VkExtent2D ChooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities);
|
||||
VkPresentModeKHR ChooseSwapPresentMode([[maybe_unused]] const std::vector<VkPresentModeKHR> &available_present_modes);
|
||||
|
||||
inline VkSwapchainKHR get() noexcept { return _swapchain; }
|
||||
inline VkSwapchainKHR operator()() noexcept { return _swapchain; }
|
||||
inline std::size_t getImagesNumber() const noexcept { return _images.size(); }
|
||||
inline Image& getImage(std::size_t i) noexcept { return _images[i]; }
|
||||
inline SwapChainSupportDetails getSupport() noexcept { return _swapchain_support; }
|
||||
inline VkExtent2D getExtent() noexcept { return _extent; }
|
||||
inline VkFormat getImagesFormat() const noexcept { return _swapchain_image_format; }
|
||||
inline VkSwapchainKHR Get() noexcept { return m_swapchain; }
|
||||
inline VkSwapchainKHR operator()() noexcept { return m_swapchain; }
|
||||
inline std::size_t GetImagesNumber() const noexcept { return m_images.size(); }
|
||||
inline Image& GetImage(std::size_t i) noexcept { return m_images[i]; }
|
||||
inline SwapChainSupportDetails GetSupport() noexcept { return m_swapchain_support; }
|
||||
inline VkExtent2D GetExtent() noexcept { return m_extent; }
|
||||
inline VkFormat GetImagesFormat() const noexcept { return m_swapchain_image_format; }
|
||||
|
||||
~SwapChain() = default;
|
||||
|
||||
private:
|
||||
SwapChainSupportDetails _swapchain_support;
|
||||
VkSwapchainKHR _swapchain;
|
||||
std::vector<Image> _images;
|
||||
VkFormat _swapchain_image_format;
|
||||
VkExtent2D _extent;
|
||||
class Renderer* _renderer = nullptr;
|
||||
SwapChainSupportDetails m_swapchain_support;
|
||||
VkSwapchainKHR m_swapchain;
|
||||
std::vector<Image> m_images;
|
||||
VkFormat m_swapchain_image_format;
|
||||
VkExtent2D m_extent;
|
||||
NonOwningPtr<class Renderer> m_renderer;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user