]> git.localhorst.tv Git - blobs.git/blob - src/app/Application.hpp
4ed4b769d916d4f043928d3364ca8b49ff8a8808
[blobs.git] / src / app / Application.hpp
1 #ifndef BLOBS_APP_APPLICATION_HPP_
2 #define BLOBS_APP_APPLICATION_HPP_
3
4 #include <stack>
5
6
7 namespace blobs {
8 namespace app {
9
10 class State;
11
12 class Application {
13
14 public:
15         Application();
16         ~Application();
17
18         Application(const Application &) = delete;
19         Application &operator =(const Application &) = delete;
20
21         Application(Application &&) = delete;
22         Application &operator =(Application &&) = delete;
23
24 public:
25         void PushState(State *);
26         State *PopState();
27         State *SwitchState(State *);
28         State &GetState();
29         bool HasState() const noexcept;
30
31         /// Loop until states is empty.
32         void Run();
33         /// Evaluate a single frame of dt milliseconds.
34         void Loop(int dt);
35         /// Process all events in queue.
36         void HandleEvents();
37
38 private:
39         std::stack<State *> states;
40
41 };
42
43 }
44 }
45
46 #endif