From 8f42815db1d3636c3fddc696b626c54ca7896d32 Mon Sep 17 00:00:00 2001 From: realtradam Date: Mon, 24 Apr 2023 03:58:04 -0400 Subject: added unbounded ranges for the input system --- include/rodeo/input.h | 8 +++++++- include/rodeo/input_t.h | 27 ++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/rodeo/input.h b/include/rodeo/input.h index 41a7849..8d3d775 100644 --- a/include/rodeo/input.h +++ b/include/rodeo/input.h @@ -48,7 +48,13 @@ rodeo_input_command_register_binary_mouseButton( bool rodeo_input_command_register_positional_mouse( rodeo_input_command_t *input_command, - rodeo_input_positional_mouse_t mouse_position + rodeo_input_positional_mouse_t mouse_axis +); + +bool +rodeo_input_command_register_unboundedRange_mouse( + rodeo_input_command_t *input_command, + rodeo_input_unboundedRange_mouse_t mouse_axis ); // alternative proposed "general" registration methods diff --git a/include/rodeo/input_t.h b/include/rodeo/input_t.h index 6013eed..f717de3 100644 --- a/include/rodeo/input_t.h +++ b/include/rodeo/input_t.h @@ -766,17 +766,28 @@ rodeo_input_binary_mouseButton_t; typedef enum { + rodeo_input_positional_mouse_Invalid = 0, rodeo_input_positional_mouse_X = 1, rodeo_input_positional_mouse_Y = 2 } rodeo_input_positional_mouse_t; +typedef +enum +{ + rodeo_input_unboundedRange_mouse_Invalid = 0, + rodeo_input_unboundedRange_mouse_X = 1, + rodeo_input_unboundedRange_mouse_Y = 2 +} +rodeo_input_unboundedRange_mouse_t; + typedef enum { rodeo_input_type_Invalid = (1 << 0), rodeo_input_type_Binary = (1 << 1), rodeo_input_type_Positional = (1 << 2), + rodeo_input_type_UnboundedRange = (1 << 3), } rodeo_input_type_t ; @@ -800,6 +811,8 @@ rodeo_input_binary_state_t; typedef int64_t rodeo_input_positional_state_t; +typedef float rodeo_input_unboundedRange_state_t; + typedef struct { @@ -807,6 +820,7 @@ struct { rodeo_input_binary_state_t binary_state; rodeo_input_positional_state_t positional_state; + rodeo_input_unboundedRange_state_t unbounded_range_state; } data; rodeo_input_type_t input_type; @@ -835,6 +849,10 @@ void #define i_tag input_positional_mouse #include +#define i_val rodeo_input_unboundedRange_mouse_t +#define i_tag input_unboundedRange_mouse +#include + typedef struct { @@ -850,11 +868,18 @@ struct } binary; - // unbounded range + // positional struct { cset_input_positional_mouse mouse_position; } + positional; + + // unbounded range + struct + { + cset_input_unboundedRange_mouse mouse_delta; + } unbounded_range; } -- cgit v1.2.3