move DevicesChanged polling into separate thread because the DInput calls block. Only supported if ThreadedInput=1.

This commit is contained in:
Chris Danford
2006-03-17 00:29:10 +00:00
parent 4dd5728ee0
commit 345a588e2d
2 changed files with 47 additions and 17 deletions
@@ -16,16 +16,22 @@ public:
void WindowReset();
private:
RageThread m_Thread;
RageThread m_InputThread;
RageThread m_DevicesChangedThread;
bool m_bShutdown;
int m_iLastSeenNumJoysticks; // use this to figure out if a joystick was plugged/unplugged
// Use these to figure out if a joystick was plugged/unplugged
int m_iCurrentNumJoysticks;
int m_iLastSeenNumJoysticks;
void UpdatePolled( DIDevice &device, const RageTimer &tm );
void UpdateBuffered( DIDevice &device, const RageTimer &tm );
void PollAndAcquireDevices( bool bBuffered );
static int InputThread_Start( void *p ) { ((InputHandler_DInput *) p)->InputThreadMain(); return 0; }
static int InputThread_Start( void *p ) { ((InputHandler_DInput *) p)->InputThreadMain(); return 0; }
static int DevicesChangedThread_Start( void *p ) { ((InputHandler_DInput *) p)->DevicesChangedThreadMain(); return 0; }
void InputThreadMain();
void DevicesChangedThreadMain();
void StartThread();
void ShutdownThread();