#ifndef MATERIAL_H
#define MATERIAL_H

#include <opengl-playground/opengltexture.hpp>
#include <memory>
#include <vector>
//#include <glm/glm.hpp>
#include <iostream>

class Material
{
	public:
		Material();
		Material(std::shared_ptr<OpenGlTexture> diffuse_texture,
		         std::shared_ptr<OpenGlTexture> ambient_texture,
		         std::shared_ptr<OpenGlTexture> specular_texture);
		Material(const glm::vec3 &diff_color, const glm::vec3 &ambient_color, const glm::vec3 &specular_color);
		void setSpecularColor(const glm::vec3 &color);
		void setAmbientColor(const glm::vec3 &color);
		void setDiffuseColor(const glm::vec3 &color);
		void pushSpecularTexture(std::shared_ptr<OpenGlTexture> texture);
		void pushAmbientTexture(std::shared_ptr<OpenGlTexture> texture);
		void pushDiffuseTexture(std::shared_ptr<OpenGlTexture> texture);
		void pushSpecularTexture(const std::vector<std::shared_ptr<OpenGlTexture>> &textures);
		void pushAmbientTexture(const std::vector<std::shared_ptr<OpenGlTexture>> &textures);
		void pushDiffuseTexture(const std::vector<std::shared_ptr<OpenGlTexture>> &textures);

		const std::vector<std::shared_ptr<OpenGlTexture>> &getSpecularTextures();
		const std::vector<std::shared_ptr<OpenGlTexture>> &getAmbientTextures();
		const std::vector<std::shared_ptr<OpenGlTexture>> &getDiffuseTextures();
		const glm::vec3 &getDiffuseColor();
		const glm::vec3 &getAmbientColor();
		const glm::vec3 &getSpecularColor();

		float shininess_strength;
		float shininess;

	private:
		std::vector<std::shared_ptr<OpenGlTexture>> diffuse_textures;
		std::vector<std::shared_ptr<OpenGlTexture>> ambient_textures;
		std::vector<std::shared_ptr<OpenGlTexture>> specular_textures;
		glm::vec3 diff_color;
		glm::vec3 ambient_color;
		glm::vec3 specular_color;

	friend std::ostream &operator<<(std::ostream &os, Material const &material);
};

#endif // MATERIAL_H
