text: #pragma once
  
  #include "directx12_utils.h"
  #include "directx12_resource.h"
  #include "directx12_command_queue.h"
  
  namespace assec::renderer
  {
  	class directx12_swap_chain
  	{
  	public:
  		directx12_swap_chain() = default;
  		directx12_swap_chain(ComPtr<ID3D12Device2> device, const directx12_command_queue& command_queue, HWND client, uint32_t buffer_count);
  		~directx12_swap_chain() = default;
  
  		const uint32_t back_buffer_index() const;
  		const directx12_resource& back_buffer() const;
  		const directx12_resource& depth_buffer() const;
  		const CD3DX12_CPU_DESCRIPTOR_HANDLE rtv_descriptor_handle() const;
  		const CD3DX12_CPU_DESCRIPTOR_HANDLE dsv_descriptor_handle() const;
  		
  		uint32_t present(bool vsync, bool tearing, const directx12_command_queue& command_queue);
  	private:
  		ComPtr<IDXGISwapChain4> m_native;
  		ComPtr<ID3D12DescriptorHeap> m_rtv_descriptor_heap;
  		uint32_t m_rtv_descriptor_size = 0;
  		std::vector<directx12_resource> m_back_buffers;
  		ComPtr<ID3D12DescriptorHeap> m_dsv_descriptor_heap;
  		directx12_resource m_depth_buffer;
  		uint32_t m_dsv_descriptor_size = 0;
  	};
  }