| 175 | } |
| 176 | |
| 177 | void SDLPlatform::Tick() |
| 178 | { |
| 179 | SDLPlatformBase::Tick(); |
| 180 | SDLInput::Update(); |
| 181 | |
| 182 | PreHandleEvents(); |
| 183 | |
| 184 | SDL_PumpEvents(); |
| 185 | SDL_Event events[32]; |
| 186 | int count = SDL_PeepEvents(events, SDL_arraysize(events), SDL_GETEVENT, SDL_EVENT_FIRST, SDL_EVENT_LAST); |
| 187 | for (int i = 0; i < count; ++i) |
| 188 | { |
| 189 | SDLWindow* window = SDLWindow::GetWindowFromEvent(events[i]); |
| 190 | if (window) |
| 191 | window->HandleEvent(events[i]); |
| 192 | else if (events[i].type >= SDL_EVENT_JOYSTICK_AXIS_MOTION && events[i].type <= SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED) |
| 193 | SDLInput::HandleEvent(nullptr, events[i]); |
| 194 | else |
| 195 | HandleEvent(events[i]); |
| 196 | } |
| 197 | |
| 198 | PostHandleEvents(); |
| 199 | } |
| 200 | |
| 201 | bool SDLPlatform::HandleEvent(SDL_Event& event) |
| 202 | { |
nothing calls this directly
no test coverage detected