#pragma once
#include "Deer/Tools/Path.h"
#include "DeerRender/Render/Shader.h"
#include "DeerRender/Resource.h"

#include <cstdint>

namespace Deer {
	struct ShaderData {
		std::string vertexShader;
		std::string fragmentShader;

		ShaderData() = default;
		~ShaderData() = default;

		ShaderData(const ShaderData&) = delete;
		ShaderData& operator=(const ShaderData&) = delete;

		void freeData() {
			vertexShader.clear();
			fragmentShader.clear();
		}
	};

	template <>
	class ResourceBuilder<Shader> {
	  public:
		using BaseDataType = ShaderData;
		static Scope<Shader> buildResource(const BaseDataType& baseData);
	};

	namespace DataStore {
		void loadShader(ShaderData& data, const Path& name);
	} // namespace DataStore
} // namespace Deer