#pragma once
#include "../vulkan.h"

namespace vulkanapi {
	class Instance;
	class InstanceCreator {
		friend class Instance;
	public:
		string appName;
		uint32_t appVersion;
		string engineName;
		uint32_t engineVersion;
		uint32_t apiVersion;

		vector<string> desiredExtensions;
		vector<string> desiredLayers;
		InstanceCreator(); 	public:

		void AddExtension(string extensionName);
		void AddLayer(string layerName);
		void AddWindowExtension();
		void AddDebugExtension();

		vector<char const*> EnabledExtensionNames();
		vector<char const*> EnabledLayerNames();
	public:
#ifdef Z_USE_GRAPHIC_DEBUG
		VkDebugUtilsMessageSeverityFlagsEXT messageSeverity;
		VkDebugUtilsMessageTypeFlagsEXT messageType;
		PFN_vkDebugUtilsMessengerCallbackEXT debugCallback;

		VkDebugUtilsMessengerCreateInfoEXT DebugUtilsLayerNext();
#endif

	private:
		static bool CheckAvailableInstanceExtensions(vector<VkExtensionProperties>& available_extensions);
		static bool CheckAvailableInstanceLayers(vector<VkLayerProperties>& available_layers);
		static bool IsExtensionSupported(vector<VkExtensionProperties> const& available_extensions,
			char const* const extension);
		static bool IsLayerSupported(vector<VkLayerProperties> const& available_layers,
			char const* const layer);
	};
};