playable with a gamepad
[vrtris] / src / gameinp.h
diff --git a/src/gameinp.h b/src/gameinp.h
new file mode 100644 (file)
index 0000000..ca8c63e
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef GAMEINP_H_
+#define GAMEINP_H_
+
+enum {
+       GINP_LEFT       = 1,
+       GINP_RIGHT      = 2,
+       GINP_UP         = 4,
+       GINP_DOWN       = 8,
+       GINP_ROTATE     = 16,
+       GINP_PAUSE      = 32
+};
+
+#define GINP_PRESS(bn)         ((ginp_bnstate & (bn)) && (ginp_bndelta & (bn)))
+#define GINP_RELEASE(bn)       ((ginp_bnstate & (bn)) == 0 && (ginp_bndelta & (bn)))
+
+unsigned int ginp_bnstate, ginp_bndelta;
+
+void ginp_repeat(int start, int rep, unsigned int mask);
+
+void update_ginp(void);
+
+
+#endif /* GAMEINP_H_ */