diff options
author | kdx <kikoodx@paranoici.org> | 2023-07-10 13:21:22 +0200 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-07-10 13:21:22 +0200 |
commit | de846cd6b857a1e41b0eb9204f9bb4a9fe1b51f3 (patch) | |
tree | 492d5ea057a32c7c8447ec9ff4b7c252a868680d /headers | |
parent | e8a9f0e2bbc766d4767a516b98167c97ff410948 (diff) | |
download | tzr-de846cd6b857a1e41b0eb9204f9bb4a9fe1b51f3.tar.gz |
joystick button input
Diffstat (limited to 'headers')
-rw-r--r-- | headers/TZR_globals.h | 1 | ||||
-rw-r--r-- | headers/TZR_joystick.h | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/headers/TZR_globals.h b/headers/TZR_globals.h index db03ce8..e12f31d 100644 --- a/headers/TZR_globals.h +++ b/headers/TZR_globals.h @@ -20,6 +20,7 @@ extern int ___tzr_mouse_x; extern int ___tzr_mouse_y; extern TZR_KeyState ___tzr_keystates[SDL_NUM_SCANCODES]; extern TZR_KeyState ___tzr_mousestates[256]; +extern TZR_KeyState ___tzr_joystates[256]; extern float ___tzr_scale; extern int ___tzr_off_x; extern int ___tzr_off_y; diff --git a/headers/TZR_joystick.h b/headers/TZR_joystick.h new file mode 100644 index 0000000..ce1a49a --- /dev/null +++ b/headers/TZR_joystick.h @@ -0,0 +1,9 @@ +#pragma once +#include "TZR_types.h" +#include <SDL2/SDL_joystick.h> + +TZR_KeyState TZR_JoystickGetState(uint8_t button); +bool TZR_JoystickDown(uint8_t button); +bool TZR_JoystickUp(uint8_t button); +bool TZR_JoystickReleased(uint8_t button); +bool TZR_JoystickPressed(uint8_t button); |