Replaced SDL_PollEvent with SDL_WaitEvent.