]> git.localhorst.tv Git - blank.git/blob - src/interface.hpp
d3d58e8470b4fb9c9883e364917831ceaffe8bdd
[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 PrintLightInfo();
38         void PrintSelectionInfo();
39         void Print(const Block &);
40
41         void SelectNext();
42         void SelectPrevious();
43
44         void Update(int dt);
45
46         void Render(DirectionalLighting &);
47
48 private:
49         World &world;
50         FPSController ctrl;
51         HUD hud;
52
53         Chunk *aim_chunk;
54         int aim_block;
55         glm::vec3 aim_normal;
56
57         OutlineModel outline;
58         glm::mat4 outline_transform;
59
60         float move_velocity;
61         float pitch_sensitivity;
62         float yaw_sensitivity;
63
64         Block remove;
65         Block selection;
66
67         bool front, back, left, right, up, down;
68
69 };
70
71 }
72
73 #endif