diff options
Diffstat (limited to 'plat.c')
-rw-r--r-- | plat.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |