2 #ifndef GAINPUTINPUTDEVICE_H_ 3 #define GAINPUTINPUTDEVICE_H_ 66 static const unsigned AutoIndex = unsigned(-1);
93 virtual const char* GetTypeName()
const = 0;
99 virtual bool IsAvailable()
const {
return GetState() == DS_OK || GetState() == DS_LOW_BATTERY; }
102 virtual bool IsValidButtonId(
DeviceButtonId deviceButton)
const = 0;
128 virtual size_t GetButtonName(
DeviceButtonId deviceButton,
char* buffer,
size_t bufferLength)
const { GAINPUT_UNUSED(deviceButton); GAINPUT_UNUSED(buffer); GAINPUT_UNUSED(bufferLength);
return 0; }
154 void SetDebugRenderingEnabled(
bool enabled);
158 #if defined(GAINPUT_DEV) || defined(GAINPUT_ENABLE_RECORDER) 159 bool IsSynced()
const {
return synced_; }
189 #if defined(GAINPUT_DEV) || defined(GAINPUT_ENABLE_RECORDER) 216 size_t CheckAllButtonsDown(
DeviceButtonSpec* outButtons,
size_t maxButtonCount,
unsigned start,
unsigned end)
const;
228 GAINPUT_ASSERT(state_);
229 return state_->GetBool(deviceButton);
240 GAINPUT_ASSERT(previousState_);
241 return previousState_->GetBool(deviceButton);
252 GAINPUT_ASSERT(state_);
253 return state_->GetFloat(deviceButton);
264 GAINPUT_ASSERT(previousState_);
265 return previousState_->GetFloat(deviceButton);