src/event.c
/* This function is called by the game loop to check the input events and
   dispatch it to the appropriate handlers. The input is either handled by
   the input manager or, if it's a code that affects the core game loop, is
   passed back to it via the event_result_t enumeration (see event.h for its
   definition). */
This function is called by the game loop to check the input events and
dispatch it to the appropriate handlers. The input is either handled by
the input manager or, if it's a code that affects the core game loop, is
passed back to it via the event_result_t enumeration (see event.h for its
definition).
This function is called by the game loop to check the input events and dispatch it to the appropriate handlers . The input is either handled by the input manager or if it ' s a code that affects the core game loop is passed back to it via the event_result_t enumeration ( see event . h for its definition ) .
event_result_t event_process() {
	SDL_Event e;
	SDL_PollEvent(&e);
	switch(e.type) {
	case SDL_KEYDOWN:
	case SDL_KEYUP:
		return event_keyboard(e);
	case SDL_MOUSEBUTTONDOWN:
	case SDL_MOUSEBUTTONUP:
		return event_mouse_button(e);
	case SDL_MOUSEWHEEL:
		return event_mouse_wheel(e);
	case SDL_MOUSEMOTION:
		return event_mouse_motion(e);
	case SDL_WINDOWEVENT:
		return event_window(e);
	case SDL_QUIT:
		return EV_QUIT;
	}
	return EV_NONE;
}
event_result_t event_process ( ) { SDL_Event e ; SDL_PollEvent ( & e ) ; switch ( e . type ) { case SDL_KEYDOWN : case SDL_KEYUP : return event_keyboard ( e ) ; case SDL_MOUSEBUTTONDOWN : case SDL_MOUSEBUTTONUP : return event_mouse_button ( e ) ; case SDL_MOUSEWHEEL : return event_mouse_wheel ( e ) ; case SDL_MOUSEMOTION : return event_mouse_motion ( e ) ; case SDL_WINDOWEVENT : return event_window ( e ) ; case SDL_QUIT : return EV_QUIT ; } return EV_NONE ; }
This function is called by the game loop to check the input events and
dispatch it to the appropriate handlers.
This function is called by the game loop to check the input events and dispatch it to the appropriate handlers .
/* Calls the appropriate handler for each supported event type. */ /* Keypress event. */ /* Mouse button event. */ /* Mouse wheel event. */ /* Mouse motion event. */ /* Window event. */ /* If a quit event is found (the main windows is closed, the window manager
	   tells us to quit, etc), send a quit message to the game loop. */ /* No recognizable event occurred. */