Vixen
02b45cc4
csharp
public sealed class DiagnosticOverlays

The set of diagnostic overlays, what is switched on, and the one call a frame that draws them.

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

Remarks

[13](../../../../docs/plan/13-diagnostics.md) § Diagnostic overlays asks for these to be toggleable and present in every build, which is the whole reason they are drawn out of DebugDraw rather than out of the editor: a build with no editor attached and no interface running still has a line pipeline, and that is the build where the numbers are most wanted.

Nothing here polls or samples. An overlay reads what its subsystem already published — Profiler's rings, RingBufferSink's records, a statistics value the host set — so turning one on costs its own drawing and nothing else, and turning all of them off costs one branch each.

Fields and properties (4)

  • public bool Enabled

    Whether any overlay is drawn at all — the single switch, for a shipping build.

  • public OverlayTheme Theme

    The colours and sizes every overlay is drawn with.

  • public IReadOnlyList<IDiagnosticOverlay> Registered

    Everything registered, in the order it is drawn.

  • public int DrawnCount

    How many panels the last Draw actually put on screen.

Methods (7)

  • public void Add(IDiagnosticOverlay overlay)

    Adds an overlay, at the end of its corner's stack.

  • public bool Remove(string name)

    Removes an overlay.

  • public IDiagnosticOverlay? Find(string? name)

    Finds a registered overlay by name, case-insensitively.

  • public bool? Set(string name, bool? enabled = null)

    Turns one overlay on or off.

  • public void RegisterCommands(ConsoleCommands commands)

    Adds the overlay and overlays commands to a console.

  • public void DisableAll()

    Turns every overlay off.

  • public void Draw(DebugDraw draw, Vector2 viewport, in GameTime time)

    Draws every enabled overlay into a frame's accumulator.

Used by (3)

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