#pragma once
#include "../vulkan.h"
namespace vulkanapi {
	class Device;
	class CommandPool;
	class CommandBuffer {
	protected:
		CommandPool& mPool;
		VkCommandBuffer mPtr;
		VkFence		mFence;
	public:
		CommandBuffer(CommandPool& commandPool, VkCommandBufferLevel level);
		~CommandBuffer();
		CommandBuffer(CommandBuffer* other)noexcept:CommandBuffer(std::forward<CommandBuffer>(*other)) {};
		CommandBuffer(CommandBuffer&& other)noexcept;
		VkCommandBuffer& Ptr() {
			return mPtr;
		};
		VkFence& Fence() {
			return mFence;
		};
		void Reset();
		void BeginRecord(VkCommandBufferUsageFlags flag);
		void EndRecord();
		void CmdCopyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, VkDeviceSize size);
		void Submit(VkQueue& queue);
		void WaitFofFence(VkDevice& device);

		void BindVertexBuffer(VkBuffer buffer, uint32_t offset);
		void BindIndexBuffers(VkBuffer buffer, uint32_t offset, VkIndexType type);
	};
}