/* Handle all pending display events Return 1 if the window was closed, 0 otherwise.  */
int sdl_handle_pending_events(void)
/* Handle all pending display events Return 1 if the window was closed, 0 otherwise.  */
int sdl_handle_pending_events(void)
{
	SDL_Event event;
	while (SDL_PollEvent(&event)) {
		switch (event.type) {
		case SDL_WINDOWEVENT:
			sdl_handle_window_event(&event);
			break;
		case SDL_QUIT:
			return 1;
		default:
			break;
		}
	}
	return 0;
}