| 118 | } |
| 119 | |
| 120 | Uint32 InputManager::devicePollingCallback(Uint32 interval, void* param) |
| 121 | { |
| 122 | //this thing my be running in a different thread, so we're not allowed to call |
| 123 | //any functions or change/allocate/delete stuff, but can send a user event |
| 124 | SDL_Event event; |
| 125 | event.user.type = SDL_USEREVENT; |
| 126 | event.user.code = SDL_USEREVENT_POLLDEVICES; |
| 127 | event.user.data1 = nullptr; |
| 128 | event.user.data2 = nullptr; |
| 129 | if (SDL_PushEvent(&event) != 0) { |
| 130 | LOG(LogError) << "InputManager::devicePollingCallback - SDL event queue is full!"; |
| 131 | } |
| 132 | |
| 133 | return interval; |
| 134 | } |
| 135 | |
| 136 | void InputManager::init() |
| 137 | { |
nothing calls this directly
no outgoing calls
no test coverage detected