Logo Mibo

AdaptiveFrameContext Type

The graph-building context handed to an AdaptiveProgramInit function and to the subscription projection (AdaptiveInit.withSubscriptions).

The context exposes the framework-owned roots: the time cell, written by the runner at the start of every Step (once per fixed sub-step), the exit-request cell, read by the runner to decide whether to stop, plus the GameContext holding the window dimensions and the registered services. The program reads these cells and derives its projections from them like any other root; only ExitRequested is written by the program. The intent queue is exposed for the Init function: work posted there runs at the startup drain, right after Init returns and before the first frame is forced, so the first frame includes its effects. The subscription projection also receives this context and must not post: it runs once per step, and work posted there would run at the next step's boundary, a step late.

Instance members

Instance member Description

this.Context

Full Usage: this.Context

Returns: GameContext

The GameContext the runner owns: the window dimensions and the registered services (IAssets, IInput, custom). Programs read services directly from here in Init and Update — the host registers what it owns and the program pulls the rest; there is no registration ceremony.

Returns: GameContext

this.ExitRequested

Full Usage: this.ExitRequested

Returns: cval<bool>

The exit-request root. Set it to true to make the runner stop — the adaptive counterpart of Cmd.signalExit.

Returns: cval<bool>

this.Intents

Full Usage: this.Intents

Returns: IntentQueue

The intent queue: the single place to post unit -> unit work. From Init, the moments are: IntentQueue.post runs at the startup drain, right after Init returns and before the first frame is forced, so the first frame includes its effects; IntentQueue.postNextFrame runs at the first step's boundary, before the first Update; and IntentQueue.postTask / postAsync start their background work at the startup drain, with the completion running at a later post drain. The adaptive counterpart of the Cmd returned from the MVU init function.

Returns: IntentQueue

this.Time

Full Usage: this.Time

Returns: cval<GameTime>

The framework-owned time root. The runner writes it at the start of every AdaptiveHeadless.Step (once per fixed sub-step); projections may depend on it (animation, physics, timers).

Returns: cval<GameTime>

this.WindowHeight

Full Usage: this.WindowHeight

Returns: int

Current window height in pixels. Default: 600.

Returns: int

this.WindowWidth

Full Usage: this.WindowWidth

Returns: int

Current window width in pixels. Default: 800.

Returns: int

Type something to start searching.