#pragma once
#include "wrapper/instance.h"
#include "wrapper/instance_creator.h"
#include "wrapper/device.h"
#include "wrapper/device_creator.h"
namespace vulkanapi {
	class CommandWorker;
	class DescriptorPool;
	class Backend{
	protected:
		Instance* mInstance;
		Device* mDevice;
		DescriptorPool* mPool;
		map<const string*, CommandWorker*> mWorkerMap;
	public:
		Instance& GetInstance() {
			return *mInstance;
		}
		Device& GetDevice() {
			return *mDevice;
		}
		DescriptorPool& GetPool() {
			return *mPool;
		}
	public:
		Backend(const string appName);
		~Backend();

		void InitWorker(const string& name, VkCommandPoolCreateFlags flag);
		CommandWorker* GetWorker(const string& name);

	public:
		static CommandWorker* TransferWorker;
		static CommandWorker* RenderWorker;
		static CommandWorker* PresentWorker;
	};
};