#pragma once

/*
	VulkanFramework
	by John Ryland
	Copyright (c) 2023
*/

////////////////////////////////////////////////////////////////////////////////////
//	Vulkan Framebuffer

#include "VulkanDevice.h"
#include "VulkanCommandPool.h"
#include <array>

namespace Vulkan {

class ImageBuffer;

class Framebuffer
{
public:
    Framebuffer();
    virtual ~Framebuffer();

    template <typename ... A>
    void Initialize(Device* device, VkRenderPass renderPass, A ... args)
    {
        ImageBuffer* buffers[] = { args ... };
        VkImageView attachments[] = { args->m_view ... };
        Initialize(device, renderPass, buffers, attachments, std::size(attachments));
    }

    virtual void Initialize(Device*               device,
                            VkRenderPass          renderPass,
                            ImageBuffer*          buffers[],
                            VkImageView           imageViews[],
                            size_t                count);
    virtual void Destroy();

    Device*               m_owner;
    uint32_t              m_width;
    uint32_t              m_height;
    VkFramebuffer         m_framebuffer;
};

} // Vulkan namespace
