Separate window buffer swapping and event polling