]> git.localhorst.tv Git - space.git/blob - src/app/Application.h
grid view
[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 "../math/Vector.h"
7 #include "../world/Universe.h"
8
9 #include <SDL/SDL.h>
10
11
12 namespace space {
13
14 class InitScreen;
15
16 class Application {
17
18 public:
19         explicit Application(InitScreen &);
20
21 public:
22         void Run();
23
24 private:
25         void Loop(int delta_ms);
26
27         void HandleEvents();
28         void OnKeyDown(const SDL_KeyboardEvent &);
29         void OnKeyUp(const SDL_KeyboardEvent &);
30
31         void Update(int delta_ms);
32
33         Vector<float> FocusVel() const;
34
35         void Render();
36
37 private:
38         InitScreen &screen;
39
40         Universe univ;
41
42         Moveable<float> focus;
43         Camera cam;
44
45         Uint32 last;
46         bool running;
47
48 };
49
50 }
51
52 #endif