dxx-rebirth/common/include/joy.h

37 lines
844 B
C
Raw Normal View History

2006-03-20 17:12:09 +00:00
/*
*
* Header for joystick functions
*
*/
#ifndef _JOY_H
#define _JOY_H
#include "pstypes.h"
2012-07-01 02:54:33 +00:00
#include "maths.h"
2013-06-30 02:22:56 +00:00
#include <SDL.h>
2006-03-20 17:12:09 +00:00
#ifdef __cplusplus
struct d_event;
#define MAX_JOYSTICKS 8
#define MAX_AXES_PER_JOYSTICK 128
#define MAX_BUTTONS_PER_JOYSTICK 128
#define MAX_HATS_PER_JOYSTICK 4
#define JOY_MAX_AXES (MAX_AXES_PER_JOYSTICK * MAX_JOYSTICKS)
#define JOY_MAX_BUTTONS (MAX_BUTTONS_PER_JOYSTICK * MAX_JOYSTICKS)
2006-03-20 17:12:09 +00:00
extern void joy_init();
2006-03-20 17:12:09 +00:00
extern void joy_close();
extern void event_joystick_get_axis(struct d_event *event, int *axis, int *value);
2006-03-20 17:12:09 +00:00
extern void joy_flush();
extern int event_joystick_get_button(struct d_event *event);
extern void joy_button_handler(SDL_JoyButtonEvent *jbe);
extern void joy_hat_handler(SDL_JoyHatEvent *jhe);
extern int joy_axis_handler(SDL_JoyAxisEvent *jae);
2006-03-20 17:12:09 +00:00
#endif
2006-03-20 17:12:09 +00:00
#endif // _JOY_H