Table of Contents

Class RenderLayerContext

Namespace
Gloam.Core.Contexts
Assembly
Gloam.Core.dll

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 IRenderer

The renderer instance for drawing operations

InputDevice IInputDevice

The input device for handling user input

FrameInfo FrameInfo

Current frame timing and performance information

Screen Size

Properties

DeltaTime

public TimeSpan DeltaTime { get; }

Property Value

TimeSpan

FrameInfo

Current frame timing and performance information

public FrameInfo FrameInfo { get; init; }

Property Value

FrameInfo

FrameNumber

public long FrameNumber { get; }

Property Value

long

InputDevice

The input device for handling user input

public IInputDevice InputDevice { get; init; }

Property Value

IInputDevice

Renderer

The renderer instance for drawing operations

public IRenderer Renderer { get; init; }

Property Value

IRenderer

Screen

public Size Screen { get; init; }

Property Value

Size

TotalTime

public TimeSpan TotalTime { get; }

Property Value

TimeSpan

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 IRenderer

The renderer to draw with

inputDevice IInputDevice

The input device for user input

startTimestamp long

Initial timestamp when the game loop started

currentTimestamp long

Current high-precision timestamp from Stopwatch.GetTimestamp()

timeSinceLastRender TimeSpan

Time elapsed since the last render

isFirstFrame bool

Whether this is the first frame being rendered

renderStep TimeSpan

The configured render step interval

Returns

RenderLayerContext

A RenderLayerContext with calculated timing information