Adds BeginFrame and EndFrame