Work on assignment 4
[opengl.git] / model.hpp
1 #include <vector>
2 #ifdef __APPLE__
3 #include <GL/glew.h>
4 #else
5 #include <OpenGL/glew.h>
6 #endif
7 #include <glm/glm.hpp>
8 #include <assimp/scene.h>
9
10 class Model {
11         public:
12                 Model(const std::string &path, GLuint progId): progId(progId) {
13                         loadModel(path);
14                 }
15                 void draw();
16         private:
17                 const GLuint progId;
18
19                 struct Mesh {
20                         Mesh(const aiMesh *aiMesh, GLuint progId);
21                         
22                         GLuint vao, vertexVbo, normalVbo, indicesVbo;
23
24                         std::vector<glm::vec3> vertices;
25                         std::vector<glm::vec3> normals;
26                         std::vector<glm::vec2> texCoords;
27                         std::vector<GLuint> indices;
28                 };
29                 
30                 std::vector<Mesh> meshes;
31                 void loadModel(const std::string &path);
32 };