]> git.localhorst.tv Git - blank.git/blob - src/interface.hpp
print block info on keypress
[blank.git] / src / interface.hpp
1 #ifndef BLANK_INTERFACE_HPP_
2 #define BLANK_INTERFACE_HPP_
3
4 #include "block.hpp"
5 #include "controller.hpp"
6 #include "hud.hpp"
7 #include "model.hpp"
8 #include "shader.hpp"
9
10 #include <SDL.h>
11
12
13 namespace blank {
14
15 class Chunk;
16 class World;
17
18 class Interface {
19
20 public:
21         explicit Interface(World &);
22
23         void Handle(const SDL_KeyboardEvent &);
24         void Handle(const SDL_MouseMotionEvent &);
25         void Handle(const SDL_MouseButtonEvent &);
26         void Handle(const SDL_MouseWheelEvent &);
27         void Handle(const SDL_WindowEvent &);
28
29         void FaceBlock();
30         void TurnBlock();
31
32         void PickBlock();
33         void PlaceBlock();
34         void RemoveBlock();
35
36         void PrintBlockInfo();
37         void PrintSelectionInfo();
38         void Print(const Block &);
39
40         void SelectNext();
41         void SelectPrevious();
42
43         void Update(int dt);
44
45         void Render(DirectionalLighting &);
46
47 private:
48         World &world;
49         FPSController ctrl;
50         HUD hud;
51
52         Chunk *aim_chunk;
53         int aim_block;
54         glm::vec3 aim_normal;
55
56         OutlineModel outline;
57         glm::mat4 outline_transform;
58
59         float move_velocity;
60         float pitch_sensitivity;
61         float yaw_sensitivity;
62
63         Block remove;
64         Block selection;
65
66         bool front, back, left, right, up, down;
67
68 };
69
70 }
71
72 #endif