Handle window events from screen.c

Only the screen knows what to do on window events.

This paves the way to handle more window events.
This commit is contained in:
Romain Vimont
2019-10-20 15:32:33 +02:00
parent 6996cbf5d3
commit f6f2868868
3 changed files with 16 additions and 6 deletions

View File

@@ -144,12 +144,7 @@ handle_event(SDL_Event *event, bool control) {
}
break;
case SDL_WINDOWEVENT:
switch (event->window.event) {
case SDL_WINDOWEVENT_EXPOSED:
case SDL_WINDOWEVENT_SIZE_CHANGED:
screen_render(&screen);
break;
}
screen_handle_window_event(&screen, &event->window);
break;
case SDL_TEXTINPUT:
if (!control) {