dungeon_crawler

view prototype/src/mesh.h @ 4:158de53b4e18

tile work
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 11 Aug 2012 05:44:52 +0300
parents 1f61f2a02832
children 8fb37db44fd8
line source
1 #ifndef MESH_H_
2 #define MESH_H_
4 #include <string>
5 #include <assimp/assimp.h>
6 #include <assimp/aiScene.h>
8 enum {
9 MESH_ATTR_VERTEX,
10 MESH_ATTR_NORMAL,
11 MESH_ATTR_TANGENT,
12 MESH_ATTR_TEXCOORD,
14 NUM_MESH_ATTR
15 };
18 class Mesh {
19 private:
20 std::string name;
22 unsigned int nverts, nfaces;
24 unsigned int vbo[NUM_MESH_ATTR];
25 unsigned int ibo;
27 int tang_loc;
29 public:
30 Mesh();
31 ~Mesh();
33 const char *get_name() const;
35 bool create(const aiScene *scn, aiMesh *aim);
36 void destroy();
38 void set_attrib_location(int attr, int loc);
39 int get_attrib_location(int attr) const;
41 void draw() const;
42 };
44 #endif // MESH_H_