diff options
author | 3gg <3gg@shellblade.net> | 2024-09-16 19:56:36 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-09-16 19:56:36 -0700 |
commit | 420970c8b83f20a4a2411af687e9d4a38a5fe81a (patch) | |
tree | bb43eeea3c863be8e1ddbb9e6effd4e01e3987fb /app/include | |
parent | 34c4c24d4e6337268fa6a318b7f333cd99b1454b (diff) |
Add function to query mouse buttons.
Diffstat (limited to 'app/include')
-rw-r--r-- | app/include/gfx/app.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/include/gfx/app.h b/app/include/gfx/app.h index 3843d92..77b6ad2 100644 --- a/app/include/gfx/app.h +++ b/app/include/gfx/app.h | |||
@@ -31,6 +31,12 @@ typedef struct GfxAppCallbacks { | |||
31 | GfxAppResize resize; | 31 | GfxAppResize resize; |
32 | } GfxAppCallbacks; | 32 | } GfxAppCallbacks; |
33 | 33 | ||
34 | typedef enum MouseButton { | ||
35 | LMB, | ||
36 | RMB, | ||
37 | MMB, | ||
38 | } MouseButton; | ||
39 | |||
34 | typedef enum Key { | 40 | typedef enum Key { |
35 | KeyA = 'a', | 41 | KeyA = 'a', |
36 | KeyB, | 42 | KeyB, |
@@ -70,8 +76,11 @@ bool gfx_app_run(const GfxAppDesc*, const GfxAppCallbacks*); | |||
70 | /// Get the mouse coordinates relative to the app's window. | 76 | /// Get the mouse coordinates relative to the app's window. |
71 | void gfx_app_get_mouse_position(double* x, double* y); | 77 | void gfx_app_get_mouse_position(double* x, double* y); |
72 | 78 | ||
79 | /// Return if the given mouse button is pressed. | ||
80 | bool gfx_app_is_mouse_button_pressed(MouseButton); | ||
81 | |||
73 | /// Return true if the given key is pressed. | 82 | /// Return true if the given key is pressed. |
74 | bool gfx_is_key_pressed(Key); | 83 | bool gfx_app_is_key_pressed(Key); |
75 | 84 | ||
76 | #ifdef __cplusplus | 85 | #ifdef __cplusplus |
77 | } // extern "C" | 86 | } // extern "C" |