#pragma once

#include <string>
#include <glm/glm.hpp>

#include "constants.h"

namespace kek {

#pragma pack(1)
struct ShaderLight {
	float color[3];
	float pad;
	float position[3];
	float pad2;
	float direction[3];
	float pad3;
	float attenuation[3]; // constant, linear, quadratic
	float pad4;
	float cutoff[2]; // inner, outer
	//float lightSpaceMatrix[16]; // mat4
	float padding[2];
};
#pragma pack(0)

// Lighting data for shader
struct LightingData {
	unsigned int blockID;
	int blockSize;
	unsigned int ubo;
	ShaderLight buffer[KEK_LIGHT_LIMIT];
};

class Shader {

public:
	unsigned int id;
	LightingData *lighting;

	Shader(std::string vertexPath, std::string fragmentPath);

	Shader(std::string vertexPath, std::string geometryPath, std::string fragmentPath);

	~Shader();

	void initLighting();

	void use();

};

}
