summaryrefslogtreecommitdiff
path: root/prge_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'prge_input.c')
-rw-r--r--prge_input.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/prge_input.c b/prge_input.c
index e295ebc..b841d6a 100644
--- a/prge_input.c
+++ b/prge_input.c
@@ -3,12 +3,15 @@ Input input_init()
Input input = {0};
input.first_mouse = 1;
input.is_running = 1;
- return(input);
+ return input;
}
void input_update(Input *input)
{
+ input->last_mouse_pos = input->mouse_pos;
input->mouse_offset = V2_ZERO;
+ input->mouse_left.last = input->mouse_left.state;
+ input->mouse_right.last = input->mouse_right.state;
input->move_right.last = input->move_right.state;
input->move_forward.last = input->move_forward.state;
@@ -26,20 +29,20 @@ void input_update(Input *input)
B32 key_is_pressed(Key key)
{
- B32 result = (key.state == KeyState_PRESS);
- return(result);
+ B32 r = (key.state == KeyState_PRESS);
+ return r;
}
B32 key_first_press(Key key)
{
- B32 result = ((key.last == KeyState_RELEASE) &&
- (key.state == KeyState_PRESS));
- return(result);
+ B32 r = ((key.last == KeyState_RELEASE) &&
+ (key.state == KeyState_PRESS));
+ return r;
}
B32 key_was_pressed(Key key)
{
- B32 result = ((key.last == KeyState_PRESS) &&
- (key.state == KeyState_RELEASE));
- return(result);
+ B32 r = ((key.last == KeyState_PRESS) &&
+ (key.state == KeyState_RELEASE));
+ return r;
}