From aedf1cb71ae46136e4299c9b71caa2a145268f3a Mon Sep 17 00:00:00 2001 From: Uneven Prankster Date: Tue, 25 Jul 2023 10:13:00 -0300 Subject: Controller header --- src/config.h | 10 +++++++++- src/controller.h | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/controller.h (limited to 'src') diff --git a/src/config.h b/src/config.h index fc12544..5099409 100644 --- a/src/config.h +++ b/src/config.h @@ -14,4 +14,12 @@ typedef i32 fx32; #define FIXED_POINT_BITS 8 #define FIXED_POINT_ONE (1 << FIXED_POINT_BITS) #define TO_FIXED(x) ((fx32)(x) << FIXED_POINT_BITS) -#define FROM_FIXED(x) ((x) >> FIXED_POINT_BITS) \ No newline at end of file +#define FROM_FIXED(x) ((x) >> FIXED_POINT_BITS) + +typedef struct{ + fx32 x, y; +}vec2; + +typedef i32 b32; +#define false 0 +#define true 1 \ No newline at end of file diff --git a/src/controller.h b/src/controller.h new file mode 100644 index 0000000..0d474a7 --- /dev/null +++ b/src/controller.h @@ -0,0 +1,12 @@ +#pragma once + +#include "config.h" + +b32 is_button_pressed(i32 btn); +b32 is_button_held(i32 btn); +b32 is_button_released(i32 btn); + +vec2 get_dir_input(void); + +void set_rumble(f32 duration, f32 strength); +void stop_rumble(void); -- cgit v1.2.3