summaryrefslogtreecommitdiffstats
path: root/engine/include/flatserial.h
blob: b9e003f4d8d1cae0734660ba2654e61a978ab655 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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