]> git.localhorst.tv Git - orbi.git/blob - src/app/Application.h
initial collision tests
[orbi.git] / src / app / Application.h
1 #ifndef ORBI_APPLICATION_H_
2 #define ORBI_APPLICATION_H_
3
4 #include "../graphics/Camera.h"
5 #include "../graphics/Moveable.h"
6 #include "../graphics/Texture.h"
7 #include "../graphics/Vector.h"
8
9 #include <SDL.h>
10
11
12 namespace orbi {
13
14 class Canvas;
15 class Tileset;
16 class World;
17
18 class Application {
19
20 public:
21         Application(Canvas &, World &, Tileset &);
22
23 public:
24         void Run();
25
26 private:
27         void Loop(int delta_ms);
28
29         void HandleEvents();
30         void OnKeyDown(const SDL_KeyboardEvent &);
31         void OnKeyUp(const SDL_KeyboardEvent &);
32
33         void Update(int delta_ms);
34
35         void Render();
36         void RenderBackground();
37         void RenderWorld();
38         void RenderEntities();
39         void RenderUI();
40
41 private:
42         Canvas &canvas;
43         World &world;
44         Tileset &tiles;
45
46         Moveable<float> focus;
47         Camera cam;
48
49         Uint32 last;
50         bool running;
51         bool paused;
52
53 };
54
55 }
56
57 #endif