summaryrefslogtreecommitdiffstats
path: root/sdl/event.h
blob: b6a1084adf35a98321d011f4054178f5b931cb91 (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
#ifndef _EVENT_H_
#define _EVENT_H_

struct platform;

/* a table holding function pointers to functions that handle events */
struct event_vtbl
{
    void (*keydown)(SDL_keysym *);
    void (*windowresize)(int, int);
};

struct event_handler
{
    struct event_vtbl funcs;     /* table of event function handlers */
    unsigned int keys_held[323]; /* keep track of the keys that were held */

    struct platform *p;          /* reference to the host platform */
    int flag;                    /* helper flag */
};

/* function prototypes */
int event_handler_init(struct platform *, struct event_vtbl *);
void sdl_process_events(void);
void event_keydown(SDL_keysym *);

#endif