2014-06-01 17:55:23 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the DXX-Rebirth project <http://www.dxx-rebirth.com/>.
|
|
|
|
* It is copyright by its individual contributors, as recorded in the
|
|
|
|
* project's Git history. See COPYING.txt at the top level for license
|
|
|
|
* terms and a link to the Git 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
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2011-02-02 00:36:49 +00:00
|
|
|
struct d_event;
|
|
|
|
|
2010-02-14 18:48:02 +00:00
|
|
|
#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
|
|
|
|
2010-02-14 18:48:02 +00:00
|
|
|
extern void joy_init();
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void joy_close();
|
2014-10-04 21:47:13 +00:00
|
|
|
extern void event_joystick_get_axis(const d_event &event, int *axis, int *value);
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void joy_flush();
|
2014-10-04 21:47:13 +00:00
|
|
|
extern int event_joystick_get_button(const d_event &event);
|
2013-01-03 15:37:52 +00:00
|
|
|
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
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#endif
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
#endif // _JOY_H
|