Quit game on ESCAPE key press or SDL_Quit event.
Move SDL initialization and closing functionality to respective display initialization and closing functions.
Move event handling code to respective separate function.
Move world drawing code to respective separate function.
Add const qualifiers to function parameters as appropriate.