Class RenderLayerContext
Provides context information for layer rendering operations including renderer, input, timing, and screen dimensions
public sealed record RenderLayerContext : IEquatable<RenderLayerContext>
- Inheritance
-
RenderLayerContext
- Implements
- Inherited Members
Constructors
RenderLayerContext(IRenderer, IInputDevice, FrameInfo, Size)
Provides context information for layer rendering operations including renderer, input, timing, and screen dimensions
public RenderLayerContext(IRenderer Renderer, IInputDevice InputDevice, FrameInfo FrameInfo, Size Screen)
Parameters
RendererIRendererThe renderer instance for drawing operations
InputDeviceIInputDeviceThe input device for handling user input
FrameInfoFrameInfoCurrent frame timing and performance information
ScreenSize
Properties
DeltaTime
public TimeSpan DeltaTime { get; }
Property Value
FrameInfo
Current frame timing and performance information
public FrameInfo FrameInfo { get; init; }
Property Value
FrameNumber
public long FrameNumber { get; }
Property Value
InputDevice
The input device for handling user input
public IInputDevice InputDevice { get; init; }
Property Value
Renderer
The renderer instance for drawing operations
public IRenderer Renderer { get; init; }
Property Value
Screen
public Size Screen { get; init; }
Property Value
TotalTime
public TimeSpan TotalTime { get; }
Property Value
Methods
Create(IRenderer, IInputDevice, long, long, TimeSpan, bool, TimeSpan)
Creates a RenderLayerContext with calculated frame information
public static RenderLayerContext Create(IRenderer renderer, IInputDevice inputDevice, long startTimestamp, long currentTimestamp, TimeSpan timeSinceLastRender, bool isFirstFrame, TimeSpan renderStep)
Parameters
rendererIRendererThe renderer to draw with
inputDeviceIInputDeviceThe input device for user input
startTimestamplongInitial timestamp when the game loop started
currentTimestamplongCurrent high-precision timestamp from Stopwatch.GetTimestamp()
timeSinceLastRenderTimeSpanTime elapsed since the last render
isFirstFrameboolWhether this is the first frame being rendered
renderStepTimeSpanThe configured render step interval
Returns
- RenderLayerContext
A RenderLayerContext with calculated timing information