aboutsummaryrefslogtreecommitdiff
path: root/plat.c
diff options
context:
space:
mode:
Diffstat (limited to 'plat.c')
-rw-r--r--plat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/plat.c b/plat.c
index 7c5c9f8..cc351ff 100644
--- a/plat.c
+++ b/plat.c
@@ -3,6 +3,18 @@
#include "memory.h"
#include "plat.h"
+int btn_pressed(const App* a, Btn btn) {
+ return a->btn_states[btn] & btn_state_pressed;
+}
+
+int btn_just_pressed(const App* a, Btn btn) {
+ return a->btn_states[btn] & btn_state_just_pressed;
+}
+
+int btn_just_released(const App* a, Btn btn) {
+ return a->btn_states[btn] & btn_state_just_released;
+}
+
#ifdef plat_posix
#define _POSIX_SOURCE
#define _GNU_SOURCE