#pragma once #ifndef _SHAPE_H_ #define _SHAPE_H_ #include #include #include class Program; /** * A shape defined by a list of triangles * - posBuf should be of length 3*ntris * - norBuf should be of length 3*ntris (if normals are available) * - texBuf should be of length 2*ntris (if texture coords are available) * posBufID, norBufID, and texBufID are OpenGL buffer identifiers. */ class Shape { public: Shape(); virtual ~Shape(); void loadMesh(const std::string &meshName); void init(); void draw(const std::shared_ptr prog) const; private: std::vector posBuf; std::vector norBuf; std::vector texBuf; unsigned posBufID; unsigned norBufID; unsigned texBufID; }; #endif