]> git.localhorst.tv Git - space.git/blob - src/app/Application.h
split render function
[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         void RenderBackground();
38         void RenderGrid();
39         void RenderShips();
40         void RenderUI();
41
42 private:
43         Canvas &canvas;
44
45         Universe univ;
46
47         Moveable<float> focus;
48         Camera cam;
49
50         Ship *controlled;
51         Vector<int> control;
52
53         DualGauge linGauge;
54         DualGauge rotGauge;
55
56         Autopilot autopilot;
57         bool apEnabled;;
58
59         Uint32 last;
60         bool running;
61         bool paused;
62
63 };
64
65 }
66
67 #endif