]> git.localhorst.tv Git - tacos.git/blob - src/world/Cursor.hpp
isolate some GL stuff
[tacos.git] / src / world / Cursor.hpp
1 #ifndef TACOS_WORLD_CURSOR_HPP_
2 #define TACOS_WORLD_CURSOR_HPP_
3
4 #include "../graphics/vao.hpp"
5
6
7 namespace tacos {
8
9 class Floor;
10
11 class Cursor {
12
13 public:
14         Cursor();
15
16         /// hide cursor
17         void Hide() noexcept;
18         /// set top left corner of cursor to focus given floor tile
19         void FloorTile(const Floor &, int tile_x, int tile_z);
20
21         bool Visible() const noexcept { return mode != HIDDEN; }
22         void Draw() const noexcept;
23
24 private:
25         struct Attributes {
26                 glm::vec3 position;
27         };
28
29         SimpleVAO<Attributes, unsigned char> vao;
30
31         // side length in vertices (make sure it's between 2 and 8 inclusive)
32         int size;
33         // distance between cursor and ground
34         float offset;
35
36         enum Mode {
37                 HIDDEN,
38                 FLOOR,
39         } mode;
40
41 };
42
43 }
44
45 #endif