Class GcCounterOverlay
- Namespace
- BSGameLib.Game.Components
- Assembly
- BSGameLib.Game.dll
Shows the garbage collector's collection counts for generations 0 to 2, and the change in managed memory, refreshed once a second.
public class GcCounterOverlay : DrawableComponent, IUpdateable, IEquatable<IUpdateable>, IDrawable, IIdentifiable<Guid>, IEquatable<IDrawable>
- Inheritance
-
GcCounterOverlay
- Implements
- Inherited Members
Constructors
GcCounterOverlay(IContentManager, IFont, Vector2, IRenderContextFactory, ITextRenderer)
Creates the overlay at position. Drawing needs renderContextFactory.
public GcCounterOverlay(IContentManager contentManager, IFont font, Vector2 position, IRenderContextFactory renderContextFactory, ITextRenderer textRenderer)
Parameters
contentManagerIContentManagerfontIFontpositionVector2renderContextFactoryIRenderContextFactorytextRendererITextRenderer
Exceptions
- ArgumentNullException
textRendereris null.
Properties
Foreground
The colour of the main copy of the text. White by default.
public Color Foreground { get; set; }
Property Value
Position
Where the main copy of the text is drawn. The shadow copy is one pixel right and down of it.
public Vector2 Position { get; set; }
Property Value
Shadow
The colour of the shadow copy of the text. Black by default.
public Color Shadow { get; set; }
Property Value
Methods
Draw(IGameTime)
Draws the text, with its shadow, once the first sample has been taken.
public override void Draw(IGameTime gameTime)
Parameters
gameTimeIGameTime
Exceptions
- InvalidOperationException
No render context factory was given to the constructor, and a sample has been taken.
Update(IGameTime)
Takes a sample once a second. The collection counts are the change since the previous sample, and the memory figure is the change in GetTotalMemory(bool).
public override void Update(IGameTime gameTime)
Parameters
gameTimeIGameTime