#pragma once
#include <Core/Common/NonNullPtr.h>

namespace Juliet::D3D12
{
    // Forward Declare
    struct D3D12Driver;
    struct D3D12WindowData;

    extern bool AcquireSwapChainTexture(NonNullPtr<CommandList> commandList, NonNullPtr<Window> window, Texture** swapChainTexture);
    extern bool WaitAndAcquireSwapChainTexture(NonNullPtr<CommandList> commandList, NonNullPtr<Window> window, Texture** swapChainTexture);
    extern bool          WaitForSwapchain(NonNullPtr<GPUDriver> driver, NonNullPtr<Window> window);
    extern TextureFormat GetSwapChainTextureFormat(NonNullPtr<GPUDriver> driver, NonNullPtr<Window> window);

    namespace Internal
    {
        extern bool CreateSwapChain(NonNullPtr<D3D12Driver> driver, NonNullPtr<D3D12WindowData> windowData,
                                    SwapChainComposition composition, PresentMode presentMode);
        extern void DestroySwapChain(NonNullPtr<D3D12Driver> driver, NonNullPtr<D3D12WindowData> windowData);
    } // namespace Internal
} // namespace Juliet::D3D12
