#pragma once
#include <stdexcept>
#include "../../shaders/Enums.h"

namespace Nebulix
{
	class ShaderCompileException: public std::exception
	{
	public:
		ShaderCompileException() = delete;

		ShaderCompileException(Nebulix::ShaderType shaderType, std::string compileMessage)
		{
			std::string shader;

			switch (shaderType)
			{
			case Nebulix::ShaderType::Vertex:
				shader = std::string{"VERTEX"};
				break;
			case Nebulix::ShaderType::Fragment:
				shader = std::string{ "FRAGMENT" };
				break;
			default:
				shader = std::string{ "UNKNOWN" };
				break;
			}
			_message = "ERROR::SHADER::" + shader + "::COMPILATION_FAILED\n Error message -> " + compileMessage;
		}

		virtual const char* what() const override
		{
			return _message.c_str();
		}

	private:
		std::string _message;
	};
}
