#ifndef IZ_JOYSTICK_H #define IZ_JOYSTICK_H #include #include #include #include "../IZ_action.h" #include "../IZ_config.h" typedef uint8_t IZ_PadButton; typedef struct { uint16_t axis_threshold; IZ_PadButton control_mapping[CONTROLS]; } IZ_JoystickConfig; typedef struct { SDL_Joystick* joystick_instance; IZ_JoystickConfig config; } IZ_JoystickState; static IZ_PadButton IZ_DEFAULT_JOYSTICK_CONTROLS[PLAYERS][CONTROLS] = { { 255, 255, 255, 255, 11, 10, 1, 0, 4, 3, 6, 7, 8, 9, 13, 14, }, }; void IZ_LoadJoystickConfig(IZ_JoystickConfig*, uint8_t); void IZ_SaveJoystickConfig(IZ_JoystickConfig*, uint8_t); void IZ_HandleJoystickEvents(SDL_Event, IZ_JoystickState*, IZ_Action*); #endif