summaryrefslogtreecommitdiff
path: root/platformer/src/controls.h
diff options
context:
space:
mode:
authorSchark <jordan@schark.online>2026-09-23 23:40:11 -0400
committerSchark <jordan@schark.online>2026-09-23 23:40:11 -0400
commit23ef8bc20310bdfad52b07a3f1e4e61c98896841 (patch)
tree007cc1d6d73ebb38d2e06422d4050f769dd65535 /platformer/src/controls.h
parentdab65412376d1b73381446f969c1461c24169811 (diff)
downloadgamedev-23ef8bc20310bdfad52b07a3f1e4e61c98896841.tar.gz
gamedev-23ef8bc20310bdfad52b07a3f1e4e61c98896841.zip
Working demogit add README.md src/
Diffstat (limited to '')
-rw-r--r--platformer/src/controls.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/platformer/src/controls.h b/platformer/src/controls.h
index dbbe936..fc2ac4d 100644
--- a/platformer/src/controls.h
+++ b/platformer/src/controls.h
@@ -43,4 +43,21 @@
#ifndef CONTROLS_H
#define CONTROLS_H
+#include <stdbool.h>
+
+#include "math3d.h"
+
+typedef struct Input {
+ Vec2 move; /* left stick after deadzone, length 0..1. +x = right, +y = forward */
+ Vec2 look; /* right stick after deadzone, length 0..1. +x = orbit right, +y = tilt up */
+ bool jump_held; /* A is down this tick */
+ bool jump_pressed; /* A went down THIS tick (one tick only) */
+ bool reset_pressed; /* Back/Select went down this tick (one tick only) */
+ bool quit_pressed; /* Start (or Esc) went down this tick (one tick only) */
+ bool using_gamepad; /* true if a gamepad produced this Input (debug info) */
+} Input;
+
+void controls_init(void);
+void controls_poll(Input *out);
+
#endif /* CONTROLS_H */