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
Renderer
IRendererThe renderer instance for drawing operations
InputDevice
IInputDeviceThe input device for handling user input
FrameInfo
FrameInfoCurrent frame timing and performance information
Screen
Size
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
renderer
IRendererThe renderer to draw with
inputDevice
IInputDeviceThe input device for user input
startTimestamp
longInitial timestamp when the game loop started
currentTimestamp
longCurrent high-precision timestamp from Stopwatch.GetTimestamp()
timeSinceLastRender
TimeSpanTime elapsed since the last render
isFirstFrame
boolWhether this is the first frame being rendered
renderStep
TimeSpanThe configured render step interval
Returns
- RenderLayerContext
A RenderLayerContext with calculated timing information