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

Function OnWindowEvent

src/Window_SDL2.c:274–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274static void OnWindowEvent(const SDL_Event* e) {
275 switch (e->window.event) {
276 case SDL_WINDOWEVENT_EXPOSED:
277 Event_RaiseVoid(&WindowEvents.RedrawNeeded);
278 break;
279 case SDL_WINDOWEVENT_SIZE_CHANGED:
280 RefreshWindowBounds();
281 Event_RaiseVoid(&WindowEvents.Resized);
282 break;
283 case SDL_WINDOWEVENT_MINIMIZED:
284 case SDL_WINDOWEVENT_MAXIMIZED:
285 case SDL_WINDOWEVENT_RESTORED:
286 Event_RaiseVoid(&WindowEvents.StateChanged);
287 break;
288 case SDL_WINDOWEVENT_FOCUS_GAINED:
289 Window_Main.Focused = true;
290 Event_RaiseVoid(&WindowEvents.FocusChanged);
291 break;
292 case SDL_WINDOWEVENT_FOCUS_LOST:
293 Window_Main.Focused = false;
294 Event_RaiseVoid(&WindowEvents.FocusChanged);
295 break;
296 case SDL_WINDOWEVENT_CLOSE:
297 Window_RequestClose();
298 break;
299 }
300}
301
302void Window_ProcessEvents(float delta) {
303 SDL_Event e;

Callers 1

Window_ProcessEventsFunction · 0.85

Calls 3

Event_RaiseVoidFunction · 0.85
RefreshWindowBoundsFunction · 0.70
Window_RequestCloseFunction · 0.70

Tested by

no test coverage detected