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