playable with a gamepad
[vrtris] / src / gameinp.h
1 #ifndef GAMEINP_H_
2 #define GAMEINP_H_
3
4 enum {
5         GINP_LEFT       = 1,
6         GINP_RIGHT      = 2,
7         GINP_UP         = 4,
8         GINP_DOWN       = 8,
9         GINP_ROTATE     = 16,
10         GINP_PAUSE      = 32
11 };
12
13 #define GINP_PRESS(bn)          ((ginp_bnstate & (bn)) && (ginp_bndelta & (bn)))
14 #define GINP_RELEASE(bn)        ((ginp_bnstate & (bn)) == 0 && (ginp_bndelta & (bn)))
15
16 unsigned int ginp_bnstate, ginp_bndelta;
17
18 void ginp_repeat(int start, int rep, unsigned int mask);
19
20 void update_ginp(void);
21
22
23 #endif  /* GAMEINP_H_ */