From 23ef8bc20310bdfad52b07a3f1e4e61c98896841 Mon Sep 17 00:00:00 2001 From: Schark Date: Wed, 23 Sep 2026 23:40:11 -0400 Subject: Working demogit add README.md src/ --- platformer/src/controls.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'platformer/src/controls.h') 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 + +#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 */ -- cgit v1.2.3-18-g5258