#ifndef MODEL_H
#define MODEL_H

#include <opengl-playground/openglgraphics.hpp>
#include <opengl-playground/mesh.hpp>
#include <vector>
#include <string>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

class Model : public OpenGlGraphics
{
	public:
		Model(const std::string &path, const glm::vec4 &static_color, std::shared_ptr<OpenGlShaderProgram> shader);
		void render();
		void realize();
	private:
		std::string model_path;
		glm::vec4 static_color;
		/*  Model Data  */
		std::vector<Mesh> meshes;
		std::vector<std::shared_ptr<OpenGlTexture>> allocated_textures;
		std::string directory;
		std::vector<std::shared_ptr<OpenGlTexture>> loadMaterialTextures(aiMaterial *mat, aiTextureType type);
		void processNode(aiNode *node, const aiScene *scene);
		Mesh processMesh(aiMesh *mesh, const aiScene *scene);
};

#endif // MODEL_H
