SparrowRenderer/phongentity.h
2015-08-04 20:10:07 +02:00

47 lines
774 B
C++

#ifndef PHONGENTITY_H
#define PHONGENTITY_H
#include <glew/glew.h>
#include <glm/mat4x4.hpp>
#include <vector>
class Mesh;
class Material;
class Shader;
#include "entity.h"
class PhongEntity : public Entity
{
private:
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);
virtual void draw(const glm::mat4 viewMatrix, const glm::mat4 projectionMatrix);
void initGL(bool isDynamic = false);
void destroyGL();
Mesh* getMesh() {return mesh;}
};
#endif // PHONGENTITY_H