Split input process and rendering in main loop.