mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
working
This commit is contained in:
@@ -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