protected override void Frame(FrameState state) { //store the global colour state.ShaderGlobals.SetShaderGlobal("colour", Color.Red.ToVector4()); //set the on screen text statusText.Text.Clear(); //framerate statusText.Text += (int)state.ApproximateFrameRate; statusText.Text += " fps"; #if DEBUG //display some statistics about the render DrawStatistics stats; state.GetPreviousFrameStatistics(out stats); statusText.Text += ", "; if (state.SupportsHardwareInstancing) { statusText.Text += stats.InstancesDrawn; statusText.Text += stats.InstancesDrawn == 1 ? " instance" : " instances"; statusText.Text += " drawn (hardware instancing)"; } else { statusText.Text += stats.DrawIndexedPrimitiveCallCount; statusText.Text += stats.DrawIndexedPrimitiveCallCount == 1 ? " instance" : " instances"; statusText.Text += " drawn"; } #endif statusText.Text.AppendLine(); statusText.Text += buttonText; //draw everything drawToScreen.Draw(state); }