| 300 | } |
| 301 | |
| 302 | void Window_ProcessEvents(float delta) { |
| 303 | SDL_Event e; |
| 304 | while (SDL_PollEvent(&e)) { |
| 305 | switch (e.type) { |
| 306 | |
| 307 | case SDL_KEYDOWN: |
| 308 | case SDL_KEYUP: |
| 309 | OnKeyEvent(&e); break; |
| 310 | case SDL_MOUSEBUTTONDOWN: |
| 311 | case SDL_MOUSEBUTTONUP: |
| 312 | OnMouseEvent(&e); break; |
| 313 | case SDL_MOUSEWHEEL: |
| 314 | Mouse_ScrollHWheel(e.wheel.x); |
| 315 | Mouse_ScrollVWheel(e.wheel.y); |
| 316 | break; |
| 317 | case SDL_MOUSEMOTION: |
| 318 | Pointer_SetPosition(0, e.motion.x, e.motion.y); |
| 319 | if (Input.RawMode) Event_RaiseRawMove(&PointerEvents.RawMoved, e.motion.xrel, e.motion.yrel); |
| 320 | break; |
| 321 | case SDL_TEXTINPUT: |
| 322 | OnTextEvent(&e); break; |
| 323 | case SDL_WINDOWEVENT: |
| 324 | OnWindowEvent(&e); break; |
| 325 | |
| 326 | case SDL_QUIT: |
| 327 | Window_Main.Exists = false; |
| 328 | Event_RaiseVoid(&WindowEvents.Closing); |
| 329 | break; |
| 330 | |
| 331 | case SDL_RENDER_DEVICE_RESET: |
| 332 | Gfx_LoseContext("SDL device reset event"); |
| 333 | Gfx_RecreateContext(); |
| 334 | break; |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | static void Cursor_GetRawPos(int* x, int* y) { |
| 340 | SDL_GetMouseState(x, y); |
nothing calls this directly
no test coverage detected