#ifndef PHONGENTITY_H
#define PHONGENTITY_H

#include <glew/glew.h>
#include <glm/mat4x4.hpp>
#include <vector>
#include "lights.h"

class Mesh;
class Material;
class Shader;

class PhongEntity
{
protected:
    enum {
		// required buffers
		POSITION_BUFFER,
		// optionnal buffers :
		NORMAL_BUFFER, TEXCOORD_BUFFER, TANGENT_BUFFER,
		// indices buffers
		INDICES_BUFFER
	};

	Mesh* mesh;

    GLuint vao;
    int nb_buffers;
    GLuint* vbo;

    void drawGroup(int groupId);
public:
    glm::mat4 modelMatrix;

    PhongEntity(Mesh* myMesh);
    ~PhongEntity();

	void draw(const glm::mat4 viewMatrix, const glm::mat4 projectionMatrix, Lights::Light* dirLight, Lights* pointLights);

    void initGL(bool isDynamic = false);
    void destroyGL();

    Mesh* getMesh() {return mesh;}
};

#endif // PHONGENTITY_H