diff options
author | Nao Pross <naopross@thearcway.org> | 2019-01-25 01:11:57 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2019-01-25 01:11:57 +0100 |
commit | bcd14a356cafe58808b4c2a14782ebb194c6abc5 (patch) | |
tree | 3bc95288b0a0172bb447ccf218fb59821f22501a /engine/include/serial.hpp | |
parent | Delete bin and test/makefile update .gitignore (diff) | |
download | flatland-bcd14a356cafe58808b4c2a14782ebb194c6abc5.tar.gz flatland-bcd14a356cafe58808b4c2a14782ebb194c6abc5.zip |
Rename everything under engine/ to remove `flat' and be `.hpp'
Diffstat (limited to 'engine/include/serial.hpp')
-rw-r--r-- | engine/include/serial.hpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/engine/include/serial.hpp b/engine/include/serial.hpp new file mode 100644 index 0000000..b9e003f --- /dev/null +++ b/engine/include/serial.hpp @@ -0,0 +1,44 @@ +#ifndef __FLATSERIAL_H__ +#define __FLATSERIAL_H__ + +#include "types.hpp" +#include <vector> +#include "SDL2/SDL.h" + +union SDL_Event; +class task_s; + +struct SDL_EventCollector +{ + task_s * checker; + task_s * eraser; + + /* Keyboard event */ + std::vector<SDL_Event> keyboard; + + /* Window resize or iconize event */ + std::vector<SDL_Event> window; + + /* Quit notification */ + std::vector<SDL_Event> quit; + + /* Custom events: useful for signals */ + std::vector<SDL_Event> user; + + // TODO other events + + SDL_EventCollector(); + ~SDL_EventCollector(); + + void collect(void*); + void erase(void*); + + const std::vector<SDL_Event>& getStack(uint32_t id) const; +}; + +namespace FlatSerial { + + extern SDL_EventCollector * collector; +} + +#endif |