Skip to content

KernelAPI reference

Struct FrameContext

Namespace: MicroEngine.Kernel
Assembly: MicroEngine.Kernel.dll
Guide: Modules and the frame schedule

What a frame system knows about time when it runs (FrameSchedule).

C#
public readonly struct FrameContext : IEquatable<FrameContext>

Implements

IEquatable<FrameContext>

Constructors

FrameContext(double, double, float, long, long)

What a frame system knows about time when it runs (FrameSchedule).

C#
public FrameContext(double Delta, double FixedDelta, float Blend, long FixedStep, long Frame)

Parameters

Delta double

Seconds this frame stands for: in real time, the elapsed time measured by the loop (paced to the display and at most MaxFrameDelta); in deterministic time, exactly FixedDelta.

FixedDelta double

Seconds of one fixed step: 1 / TimeSettings.FixedRate.

Blend float

How far the frame is between the last fixed step and the next one, 0..1: the part of a step of time that has passed but has not been simulated yet. Drawing at Lerp(previous, current, Blend) makes motion even on displays whose rate is not a multiple of the fixed rate. Always 1 in deterministic time (the frame shows exactly the last step) and 0 inside the fixed phases (they run on a step boundary).

FixedStep long

The number of fixed steps completed before this moment; inside a fixed phase, the index of the step being run, from 0.

Frame long

The number of the frame, from 1 for the first frame run.

Properties

Blend

How far the frame is between the last fixed step and the next one, 0..1: the part of a step of time that has passed but has not been simulated yet. Drawing at Lerp(previous, current, Blend) makes motion even on displays whose rate is not a multiple of the fixed rate. Always 1 in deterministic time (the frame shows exactly the last step) and 0 inside the fixed phases (they run on a step boundary).

C#
public float Blend { get; init; }

Property Value

float

Delta

Seconds this frame stands for: in real time, the elapsed time measured by the loop (paced to the display and at most MaxFrameDelta); in deterministic time, exactly FixedDelta.

C#
public double Delta { get; init; }

Property Value

double

FixedDelta

Seconds of one fixed step: 1 / TimeSettings.FixedRate.

C#
public double FixedDelta { get; init; }

Property Value

double

FixedStep

The number of fixed steps completed before this moment; inside a fixed phase, the index of the step being run, from 0.

C#
public long FixedStep { get; init; }

Property Value

long

Frame

The number of the frame, from 1 for the first frame run.

C#
public long Frame { get; init; }

Property Value

long

Methods

Deconstruct(out double, out double, out float, out long, out long)

C#
public void Deconstruct(out double Delta, out double FixedDelta, out float Blend, out long FixedStep, out long Frame)

Parameters

Delta double

FixedDelta double

Blend float

FixedStep long

Frame long

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(FrameContext)

C#
public bool Equals(FrameContext other)

Parameters

other FrameContext

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(FrameContext, FrameContext)

C#
public static bool operator ==(FrameContext left, FrameContext right)

Parameters

left FrameContext

right FrameContext

Returns

bool

operator !=(FrameContext, FrameContext)

C#
public static bool operator !=(FrameContext left, FrameContext right)

Parameters

left FrameContext

right FrameContext

Returns

bool