MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Window_ProcessEvents

Function Window_ProcessEvents

src/Window_BeOS.cpp:497–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497void Window_ProcessEvents(float delta) {
498 CCEvent event;
499 int key;
500
501 while (Events_Pull(&event))
502 {
503 switch (event.type)
504 {
505 case CC_MOUSE_SCROLL:
506 Mouse_ScrollVWheel(event.v1.f32);
507 Mouse_ScrollHWheel(event.v2.f32);
508 break;
509 case CC_MOUSE_DOWN:
510 Input_SetPressed(event.v1.i32);
511 break;
512 case CC_MOUSE_UP:
513 Input_SetReleased(event.v1.i32);
514 break;
515 case CC_MOUSE_MOVE:
516 Pointer_SetPosition(0, event.v1.i32, event.v2.i32);
517 break;
518 case CC_KEY_DOWN:
519 key = MapNativeKey(event.v1.i32);
520 if (key) Input_SetPressed(key);
521 break;
522 case CC_KEY_UP:
523 key = MapNativeKey(event.v1.i32);
524 if (key) Input_SetReleased(key);
525 break;
526 case CC_KEY_INPUT:
527 Event_RaiseInt(&InputEvents.Press, event.v1.i32);
528 break;
529 case CC_WIN_RESIZED:
530 Window_Main.Width = event.v1.i32;
531 Window_Main.Height = event.v2.i32;
532 Event_RaiseVoid(&WindowEvents.Resized);
533 break;
534 case CC_WIN_FOCUS:
535 Window_Main.Focused = event.v1.i32;
536 Event_RaiseVoid(&WindowEvents.FocusChanged);
537 break;
538 case CC_WIN_REDRAW:
539 Event_RaiseVoid(&WindowEvents.RedrawNeeded);
540 break;
541 case CC_WIN_QUIT:
542 Window_Main.Exists = false;
543 Window_RequestClose();
544 break;
545 case CC_RAW_MOUSE:
546 if (Input.RawMode) Event_RaiseRawMove(&PointerEvents.RawMoved, event.v1.i32, event.v2.i32);
547 break;
548 }
549 }
550}
551
552void Gamepads_PreInit(void) { }
553

Callers

nothing calls this directly

Calls 11

Mouse_ScrollVWheelFunction · 0.85
Mouse_ScrollHWheelFunction · 0.85
Input_SetPressedFunction · 0.85
Input_SetReleasedFunction · 0.85
Pointer_SetPositionFunction · 0.85
Event_RaiseIntFunction · 0.85
Event_RaiseVoidFunction · 0.85
Event_RaiseRawMoveFunction · 0.85
Events_PullFunction · 0.70
MapNativeKeyFunction · 0.70
Window_RequestCloseFunction · 0.70

Tested by

no test coverage detected