See the example for renderOffset for an example using beginNewFrame( ).