diff options
author | kdx <kikoodx@paranoici.org> | 2023-07-10 20:18:37 +0200 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-07-10 20:19:51 +0200 |
commit | 53b5a8abe962701b894980c52cc045704cccb2c4 (patch) | |
tree | 59b29c34e6422eabcaec89da2c22900cca51fb0c /headers | |
parent | a9617e017b78fe41f109dc4c943a53d914e30b79 (diff) | |
download | tzr-53b5a8abe962701b894980c52cc045704cccb2c4.tar.gz |
sticks
Diffstat (limited to 'headers')
-rw-r--r-- | headers/TZR_globals.h | 2 | ||||
-rw-r--r-- | headers/TZR_joystick.h | 4 | ||||
-rw-r--r-- | headers/TZR_types.h | 11 |
3 files changed, 16 insertions, 1 deletions
diff --git a/headers/TZR_globals.h b/headers/TZR_globals.h index e63859b..3752577 100644 --- a/headers/TZR_globals.h +++ b/headers/TZR_globals.h @@ -25,6 +25,6 @@ extern float ___tzr_scale; extern int ___tzr_off_x; extern int ___tzr_off_y; extern Mix_Music *___tzr_music; -extern SDL_GameController **___tzr_joysticks; +extern TZR_Joystick *___tzr_joysticks; extern size_t ___tzr_joysticks_capacity; extern size_t ___tzr_joysticks_size; diff --git a/headers/TZR_joystick.h b/headers/TZR_joystick.h index 36a80e2..51e4279 100644 --- a/headers/TZR_joystick.h +++ b/headers/TZR_joystick.h @@ -7,3 +7,7 @@ bool TZR_JoystickDown(uint8_t button); bool TZR_JoystickUp(uint8_t button); bool TZR_JoystickReleased(uint8_t button); bool TZR_JoystickPressed(uint8_t button); +float TZR_JoystickLeftX(void); +float TZR_JoystickLeftY(void); +float TZR_JoystickRightX(void); +float TZR_JoystickRightY(void); diff --git a/headers/TZR_types.h b/headers/TZR_types.h index 2f0a2dc..5af1f17 100644 --- a/headers/TZR_types.h +++ b/headers/TZR_types.h @@ -2,6 +2,7 @@ #include <stdbool.h> #include <SDL2/SDL_render.h> #include <SDL2/SDL_mixer.h> +#include <SDL2/SDL_gamecontroller.h> enum TZR_ResourceType { TZR_RES_RAW, @@ -46,6 +47,7 @@ typedef struct TZR_DrawImageArgs TZR_DrawImageArgs; typedef struct TZR_DrawRectangleArgs TZR_DrawRectangleArgs; typedef struct TZR_PlaySoundArgs TZR_PlaySoundArgs; typedef enum TZR_KeyState TZR_KeyState; +typedef struct TZR_Joystick TZR_Joystick; struct TZR_Config { int _; @@ -143,3 +145,12 @@ struct TZR_PlaySoundArgs { int loop; float volume; }; + +struct TZR_Joystick +{ + SDL_GameController *ptr; + float leftx; + float lefty; + float rightx; + float righty; +}; |