diff options
| -rw-r--r-- | src/config.h | 10 | ||||
| -rw-r--r-- | src/controller.h | 12 |
2 files changed, 21 insertions, 1 deletions
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); |
