renamed begin/end frame to pump_events/swap