]> git.localhorst.tv Git - gong.git/blob - src/app/State.hpp
code, assets, and other stuff stolen from blank
[gong.git] / src / app / State.hpp
1 #ifndef GONG_APP_STATE_HPP_
2 #define GONG_APP_STATE_HPP_
3
4 #include <SDL.h>
5
6
7 namespace gong {
8 namespace graphics {
9         class Viewport;
10 }
11
12 namespace app {
13
14 class Application;
15 class HeadlessApplication;
16
17
18 struct State {
19
20         friend class Application;
21         friend class HeadlessApplication;
22
23         virtual void Handle(const SDL_Event &) = 0;
24
25         virtual void Update(int dt) = 0;
26
27         virtual void Render(graphics::Viewport &) = 0;
28
29
30 private:
31         int ref_count = 0;
32
33         virtual void OnEnter() { }
34         virtual void OnResume() { }
35         virtual void OnPause() { }
36         virtual void OnExit() { }
37
38         virtual void OnFocus() { }
39         virtual void OnBlur() { }
40         virtual void OnResize(graphics::Viewport &) { }
41
42 };
43
44 }
45 }
46
47 #endif