]> git.localhorst.tv Git - space.git/blob - src/app/Application.h
17fdce8c84b77f7074477563dd67bf9eef203e8d
[space.git] / src / app / Application.h
1 #ifndef SPACE_APPLICATION_H_
2 #define SPACE_APPLICATION_H_
3
4 #include "../ai/Autopilot.h"
5 #include "../graphics/Camera.h"
6 #include "../graphics/Moveable.h"
7 #include "../graphics/Vector.h"
8 #include "../ui/DualGauge.h"
9 #include "../world/Universe.h"
10
11 #include <SDL.h>
12
13
14 namespace space {
15
16 class Canvas;
17 class Ship;
18
19 class Application {
20
21 public:
22         explicit Application(Canvas &);
23
24 public:
25         void Run();
26
27 private:
28         void Loop(int delta_ms);
29
30         void HandleEvents();
31         void OnKeyDown(const SDL_KeyboardEvent &);
32         void OnKeyUp(const SDL_KeyboardEvent &);
33
34         void Update(int delta_ms);
35
36         void Render();
37
38 private:
39         Canvas &canvas;
40
41         Universe univ;
42
43         Moveable<float> focus;
44         Camera cam;
45
46         Ship *controlled;
47         Vector<int> control;
48
49         DualGauge linGauge;
50         DualGauge rotGauge;
51
52         Autopilot autopilot;
53         bool apEnabled;;
54
55         Uint32 last;
56         bool running;
57         bool paused;
58
59 };
60
61 }
62
63 #endif