00001 #ifndef INPUTHANDLER_DIRECTINPUT_H 00002 #define INPUTHANDLER_DIRECTINPUT_H 00003 00004 #include "InputHandler.h" 00005 #include "RageThreads.h" 00006 00007 struct DIDevice; 00008 class InputHandler_DInput: public InputHandler 00009 { 00010 RageThread InputThread; 00011 bool shutdown; 00012 00013 void UpdatePolled(DIDevice &device, const RageTimer &tm); 00014 void UpdateBuffered(DIDevice &device, const RageTimer &tm); 00015 void PollAndAcquireDevices(); 00016 00017 static int InputThread_Start( void *p ) { ((InputHandler_DInput *) p)->InputThreadMain(); return 0; } 00018 void InputThreadMain(); 00019 00020 void StartThread(); 00021 void ShutdownThread(); 00022 00023 public: 00024 InputHandler_DInput(); 00025 ~InputHandler_DInput(); 00026 void GetDevicesAndDescriptions(vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut); 00027 void Update(float fDeltaTime); 00028 void WindowReset(); 00029 }; 00030 00031 #endif 00032 00033 /* 00034 * (c) 2003-2004 Glenn Maynard 00035 * All rights reserved. 00036 * 00037 * Permission is hereby granted, free of charge, to any person obtaining a 00038 * copy of this software and associated documentation files (the 00039 * "Software"), to deal in the Software without restriction, including 00040 * without limitation the rights to use, copy, modify, merge, publish, 00041 * distribute, and/or sell copies of the Software, and to permit persons to 00042 * whom the Software is furnished to do so, provided that the above 00043 * copyright notice(s) and this permission notice appear in all copies of 00044 * the Software and that both the above copyright notice(s) and this 00045 * permission notice appear in supporting documentation. 00046 * 00047 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00048 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00049 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00050 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00051 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00052 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00053 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00054 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00055 * PERFORMANCE OF THIS SOFTWARE. 00056 */