#ifndef PHONGENTITY_H #define PHONGENTITY_H #include #include #include class Mesh; class Material; class Shader; class PhongEntity { protected: Mesh* mesh; // modern opengl : enum { // required buffers POSITION_BUFFER, // optionnal buffers : NORMAL_BUFFER, TEXCOORD_BUFFER, TANGENT_BUFFER, // indices buffers INDICES_BUFFER }; GLuint vao; int nb_buffers; GLuint* vbo; void modernInit(bool isDynamic); // old opengl : GLuint displayList; void crappyInit(); public: /** * @brief the model matrix is public, so the user can manipulate it in any way he desires. */ glm::mat4 modelMatrix; PhongEntity(Mesh* myMesh); void drawDisplayList(); void drawGroup(int groupId); // temporarily public void initGL(bool isDynamic = false); void destroyGL(); Mesh* getMesh() {return mesh;} /** * @brief this method returns a clone of the current entity. * The same VAO/displayList will be used to render both, so there is no need to call initGL on the clone */ PhongEntity* clone(); }; #endif // PHONGENTITY_H