Use SDL_WaitEvent() instead of SDL_PollEvent().
Added some conditional flags for configuration/building process.