summaryrefslogtreecommitdiff
path: root/src/systems
diff options
context:
space:
mode:
Diffstat (limited to 'src/systems')
-rw-r--r--src/systems/input.c6
-rw-r--r--src/systems/input.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/systems/input.c b/src/systems/input.c
index a371ecd..87a0678 100644
--- a/src/systems/input.c
+++ b/src/systems/input.c
@@ -96,3 +96,9 @@ bool key_is_pressed(keycode key) { return g_input->depressed_keys[key]; }
bool key_just_pressed(keycode key) { return g_input->just_pressed_keys[key]; }
bool key_just_released(keycode key) { return g_input->just_released_keys[key]; }
+
+bool MouseBtn_Held() {
+ return g_input->mouse.prev_left_btn_pressed && g_input->mouse.left_btn_pressed;
+}
+
+mouse_state Input_GetMouseState() { return g_input->mouse; } \ No newline at end of file
diff --git a/src/systems/input.h b/src/systems/input.h
index f928ed1..ce6e190 100644
--- a/src/systems/input.h
+++ b/src/systems/input.h
@@ -34,9 +34,14 @@ bool key_just_pressed(keycode key);
/** @brief `key` was just released */
bool key_just_released(keycode key);
+// TODO: right btn as well
+bool MouseBtn_Held();
+
// --- Lifecycle
bool Input_Init(Input_State *input, struct GLFWwindow *window);
void Input_Shutdown(Input_State *input);
void Input_Update(Input_State *state); // must be run once per main loop
+
+PUB mouse_state Input_GetMouseState(); \ No newline at end of file