2 #ifndef GAINPUTINPUTMANAGER_H_ 3 #define GAINPUTINPUTMANAGER_H_ 46 void SetDisplaySize(
int width,
int height) { displayWidth_ = width; displayHeight_ = height; }
48 #if defined(GAINPUT_PLATFORM_LINUX) 54 void HandleEvent(XEvent& event);
56 #if defined(GAINPUT_PLATFORM_WIN) 62 void HandleMessage(
const MSG& msg);
64 #if defined(GAINPUT_PLATFORM_ANDROID) 65 int32_t HandleInput(AInputEvent* event);
100 void Update(uint64_t deltaTime);
106 uint64_t GetTime()
const;
142 DeviceId FindDeviceId(
const char* typeName,
unsigned index)
const;
158 iterator
begin() {
return devices_.begin(); }
160 iterator
end() {
return devices_.end(); }
162 const_iterator
begin()
const {
return devices_.begin(); }
164 const_iterator
end()
const {
return devices_.end(); }
179 void ReorderListeners();
187 size_t GetAnyButtonDown(
DeviceButtonSpec* outButtons,
size_t maxButtonCount)
const;
199 void RemoveDeviceStateModifier(
ModifierId modifierId);
205 void ConnectForStateSync(
const char* ip,
unsigned port);
207 void StartDeviceStateSync(
DeviceId deviceId);
210 void SetDebugRenderingEnabled(
bool enabled);
222 unsigned nextDeviceId_;
225 unsigned nextListenerId_;
229 unsigned nextModifierId_;
233 uint64_t currentTime_;
248 GAINPUT_CONC_QUEUE(Change) concurrentInputs_;
254 bool debugRenderingEnabled_;
271 T* device = allocator_.New<T>(*
this, nextDeviceId_, index, variant);
272 devices_[nextDeviceId_] = device;
273 DeviceCreated(device);
274 return nextDeviceId_++;
282 T* device = allocator_.New<T>(*
this, nextDeviceId_, index, variant);
283 devices_[nextDeviceId_] = device;
285 DeviceCreated(device);
294 if (it == devices_.end())
306 if (it == devices_.end())