X-Git-Url: http://git.lukelau.me/?p=opengl.git;a=blobdiff_plain;f=model.hpp;fp=model.hpp;h=0339538429cc94ae87292ff3f53e56cd460777a6;hp=0000000000000000000000000000000000000000;hb=b64cd5a5ec09e6f051583371045ef7080c69b776;hpb=da829a43b9ab76ce8830bd83760e59f016787727 diff --git a/model.hpp b/model.hpp new file mode 100644 index 0000000..0339538 --- /dev/null +++ b/model.hpp @@ -0,0 +1,32 @@ +#include +#ifdef __APPLE__ +#include +#else +#include +#endif +#include +#include + +class Model { + public: + Model(const std::string &path, GLuint progId): progId(progId) { + loadModel(path); + } + void draw(); + private: + const GLuint progId; + + struct Mesh { + Mesh(const aiMesh *aiMesh, GLuint progId); + + GLuint vao, vertexVbo, normalVbo, indicesVbo; + + std::vector vertices; + std::vector normals; + std::vector texCoords; + std::vector indices; + }; + + std::vector meshes; + void loadModel(const std::string &path); +};