]> git.localhorst.tv Git - blank.git/blob - src/app.hpp
place and remove blocks via mouse
[blank.git] / src / app.hpp
1 #ifndef BLANK_APP_HPP_
2 #define BLANK_APP_HPP_
3
4 #include <glm/glm.hpp>
5 #include <glm/gtc/matrix_transform.hpp>
6
7 #include "camera.hpp"
8 #include "controller.hpp"
9 #include "init.hpp"
10 #include "model.hpp"
11 #include "shader.hpp"
12 #include "world.hpp"
13
14
15 namespace blank {
16
17 class Application {
18
19 public:
20         Application();
21
22         Application(const Application &) = delete;
23         Application &operator =(const Application &) = delete;
24
25         void Run();
26         void Loop(int dt);
27
28         void HandleEvents();
29         void Update(int dt);
30         void Render();
31
32 private:
33         InitSDL init_sdl;
34         InitIMG init_img;
35         InitGL init_gl;
36         Window window;
37         GLContext ctx;
38         InitGLEW init_glew;
39         Program program;
40
41         float move_velocity;
42         float pitch_sensitivity;
43         float yaw_sensitivity;
44
45         BlockTypeRegistry blockType;
46
47         Camera cam;
48         Chunk chunk;
49         OutlineModel outline;
50
51         bool outline_visible;
52         glm::mat4 outline_transform;
53
54         glm::vec3 light_position;
55         glm::vec3 light_color;
56         float light_power;
57
58         GLuint m_handle;
59         GLuint v_handle;
60         GLuint mv_handle;
61         GLuint mvp_handle;
62         GLuint light_position_handle;
63         GLuint light_color_handle;
64         GLuint light_power_handle;
65
66         bool running;
67
68         bool front, back, left, right, up, down;
69         bool place, remove, pick;
70
71         int remove_id;
72         int place_id;
73
74 };
75
76 }
77
78 #endif