Files
itgmania212121/stepmania/src/RageInput.h
T

59 lines
1.4 KiB
C++
Raw Normal View History

#ifndef RAGEINPUT_H
#define RAGEINPUT_H
/*
-----------------------------------------------------------------------------
File: RageInput.h
Desc: Wrapper for SDL's input routines. Generates InputEvents.
2002-05-19 01:59:48 +00:00
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
2001-11-03 10:52:42 +00:00
#include "RageInputDevice.h"
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
{
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
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];
/* Structure for reading Pump pads: */
2003-02-15 06:00:33 +00:00
struct pump_t;
pump_t *m_Pumps;
2001-11-03 10:52:42 +00:00
public:
RageInput();
2001-11-03 10:52:42 +00:00
~RageInput();
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
};
namespace USB {
char *GetUSBDevicePath (int num);
HANDLE OpenUSB (int VID, int PID, int num);
};
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
#endif
/*
* Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
* Chris Danford
* Glenn Maynard
*/