summaryrefslogtreecommitdiff
path: root/prge_input.c
diff options
context:
space:
mode:
authorpryazha <pryadeiniv@mail.ru>2025-03-19 08:46:04 +0500
committerpryazha <pryadeiniv@mail.ru>2025-03-19 08:46:04 +0500
commitb1389bad67cccd3da6815c2d5a436c177f09594b (patch)
tree393dee77b5faef3cfd6e78eda8ac07273cdcc85e /prge_input.c
parent34821e9fefb0d7cbf9e72a2457b2901edbbe03bb (diff)
window, texture, model, camera and gui (silly button)
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;
}