dxtest2

view src/mesh.h @ 0:6ed01ded71d8

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 23 Jun 2013 04:23:13 +0300
parents
children
line source
1 #ifndef MESH_H_
2 #define MESH_H_
4 #include <vector>
5 #include <vmath/vmath.h>
6 #include <d3d11.h>
8 struct Vertex {
9 Vector3 pos, normal;
10 Vector2 texcoord;
11 };
13 class Mesh {
14 private:
15 Vector3 cur_norm;
16 Vector2 cur_texcoord;
18 std::vector<Vertex> verts;
19 ID3D11Buffer *vbuf;
21 bool update_vbuffer();
22 void invalidate_vbuffer();
24 public:
25 Mesh();
26 ~Mesh();
28 void clear();
30 void normal(float x, float y, float z);
31 void texcoord(float u, float v);
32 void vertex(float x, float y, float z);
34 void draw() const;
35 };
37 #endif // MESH_H_