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