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