Vixen
02b45cc4
csharp
public sealed class FrameStatsOverlay

The frame-stats overlay: rate, the CPU/GPU split, what was drawn, and what memory is doing.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The one overlay worth leaving on, and therefore the one that has to be cheap enough to leave on. It allocates nothing per frame: every number is formatted into a stack buffer and the history behind the graph is a fixed array written round.

Frame time is graphed, not only printed. A mean of 16.7 ms and a mean of 16.7 ms with a 60 ms spike every second are the same number and completely different games, and the spike is the one somebody is complaining about. The graph is the last HistoryLength frames, unsmoothed, with the budget drawn across it.

Fields and properties (8)

  • public const int HistoryLength

    How many frames the graph remembers.

  • public string Name

    What the console and the toggles call it. Lower case, no spaces.

  • public OverlayAnchor Anchor

    Which corner it is pinned to.

  • public bool Enabled

    Whether it is drawn.

  • public float Width

    How wide the panel is, in pixels.

  • public FrameStatistics Statistics

    What the renderer reported. The host sets this once a frame.

  • public float SmoothedMilliseconds

    The smoothed frame time, in milliseconds.

  • public float PeakMilliseconds

    The worst frame in the graph's window, in milliseconds.

Methods (2)

  • public void Draw(OverlaySurface surface, in GameTime time)

    Draws it.

  • public void Reset()

    Forgets the graph's history and the running average.

Used by (2)

  • ConsoleTestsVixen.Engine.Tests
  • DiagnosticOverlayTestsVixen.Engine.Tests