for_each_frame: new util, iterates frames with a callback