2002-11-16 08:07:38 +00:00
|
|
|
#ifndef RAGEINPUT_H
|
|
|
|
|
#define RAGEINPUT_H
|
2001-11-04 19:34:28 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
File: RageInput.h
|
|
|
|
|
|
2002-11-29 20:37:12 +00:00
|
|
|
Desc: Wrapper for SDL's input routines. Generates InputEvents.
|
2001-11-04 19:34:28 +00:00
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-11-29 20:37:12 +00:00
|
|
|
Chris Danford
|
2001-11-04 19:34:28 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
2001-11-03 10:52:42 +00:00
|
|
|
|
2003-02-15 18:49:18 +00:00
|
|
|
#include "RageInputDevice.h"
|
|
|
|
|
|
2002-11-29 20:37:12 +00:00
|
|
|
struct _SDL_Joystick;
|
|
|
|
|
typedef struct _SDL_Joystick SDL_Joystick;
|
2001-11-21 03:21:00 +00:00
|
|
|
|
2001-11-03 10:52:42 +00:00
|
|
|
class RageInput
|
|
|
|
|
{
|
2002-11-29 20:37:12 +00:00
|
|
|
SDL_Joystick* m_pJoystick[NUM_JOYSTICKS];
|
2001-11-03 10:52:42 +00:00
|
|
|
|
2003-02-15 06:44:53 +00:00
|
|
|
enum State { CURRENT = 0, LAST, NUM_STATES };
|
2001-11-03 10:52:42 +00:00
|
|
|
|
2003-02-15 18:28:39 +00:00
|
|
|
struct state_t {
|
|
|
|
|
struct device_t {
|
|
|
|
|
bool button[NUM_DEVICE_BUTTONS];
|
|
|
|
|
} m_Devices[NUM_INPUT_DEVICES];
|
2003-02-15 06:44:53 +00:00
|
|
|
} state[NUM_STATES];
|
2002-08-20 22:51:12 +00:00
|
|
|
|
|
|
|
|
/* Structure for reading Pump pads: */
|
2003-02-15 06:00:33 +00:00
|
|
|
struct pump_t;
|
|
|
|
|
pump_t *m_Pumps;
|
2002-08-20 22:51:12 +00:00
|
|
|
|
2001-11-03 10:52:42 +00:00
|
|
|
public:
|
2002-11-29 20:37:12 +00:00
|
|
|
RageInput();
|
2001-11-03 10:52:42 +00:00
|
|
|
~RageInput();
|
|
|
|
|
|
2002-11-29 20:37:12 +00:00
|
|
|
void Update( float fDeltaTime );
|
|
|
|
|
bool BeingPressed( DeviceInput di, bool bPrevState );
|
|
|
|
|
bool IsBeingPressed( DeviceInput di ) { return BeingPressed(di, false); }
|
|
|
|
|
bool WasBeingPressed( DeviceInput di ) { return BeingPressed(di, true); }
|
2001-11-03 10:52:42 +00:00
|
|
|
};
|
|
|
|
|
|
2002-08-20 22:51:12 +00:00
|
|
|
namespace USB {
|
|
|
|
|
char *GetUSBDevicePath (int num);
|
2002-11-29 22:06:51 +00:00
|
|
|
HANDLE OpenUSB (int VID, int PID, int num);
|
2002-08-20 22:51:12 +00:00
|
|
|
};
|
2001-11-03 10:52:42 +00:00
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
extern RageInput* INPUTMAN; // global and accessable from anywhere in our program
|
2002-11-11 04:53:31 +00:00
|
|
|
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|
2003-02-15 18:49:18 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
* Chris Danford
|
|
|
|
|
* Glenn Maynard
|
|
|
|
|
*/
|