AdaptiveProgram Module
Functions for creating and configuring adaptive programs.
Functions and values
| Function or value |
Description
|
Full Usage:
AdaptiveProgram.mkProgram init update
Parameters:
AdaptiveFrameContext -> AdaptiveInit<'Frame>
-
Builds the graph and returns the AdaptiveInit. Receives the AdaptiveFrameContext; work posted through its Intents member runs at the startup drain, before the first frame is forced.
update : AdaptiveContext -> GameTime -> unit
-
Per-frame phase: reads projections, writes roots, posts intents. Receives the full AdaptiveContext.
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Creates a new adaptive program with the given This is the starting point for building an adaptive game, mirroring Program.mkProgram. The init function builds the dependency graph (roots and projections) and returns the frame builder; the update function is the per-frame imperative phase that reads projections and writes roots.
|
Full Usage:
AdaptiveProgram.observe onNext
Parameters:
GameContext * 'Frame * GameTime -> unit
Returns: IObserver<GameContext * 'Frame * GameTime>
Modifiers: inline Type parameters: 'Frame |
Creates a
|
Full Usage:
AdaptiveProgram.withAssetsBasePath basePath program
Parameters:
string
program : AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Configures a base path for asset loading.
|
Full Usage:
AdaptiveProgram.withConfig configure program
Parameters:
GameConfig -> GameConfig
program : AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Configure game settings (resolution, title, framerate). The callback receives the current GameConfig and returns a modified copy.
|
Full Usage:
AdaptiveProgram.withFixedStep cfg program
Parameters:
AdaptiveFixedStepConfig
program : AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Enables a framework-managed fixed timestep. When enabled, the runner
converts the variable frame time into zero or more fixed-size steps per
|
Full Usage:
AdaptiveProgram.withInput program
Parameters:
AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Enables the reactive input polling service.
Registers IInput in the GameContext service
container and polls it once per frame before
|
Full Usage:
AdaptiveProgram.withObserver factory program
Parameters:
unit -> IObserver<GameContext * 'Frame * GameTime>
program : AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Adds an observer factory to the program. Observers receive the forced frame each step, in registration order.
|
Full Usage:
AdaptiveProgram.withProfiler profiler program
Parameters:
FrameProfiler
program : AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Supplies the frame profiler the host registers and measures with.
Without it the host measures nothing. The profiler itself decides the
measurement window and whether screenshots are possible; its
|
Full Usage:
AdaptiveProgram.withRenderer factory program
Parameters:
unit -> IRenderer<'Frame>
program : AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Adds a renderer factory to the program. Renderers are called each frame to draw the forced frame, in registration order.
|
Full Usage:
AdaptiveProgram.withServiceRegistration register program
Parameters:
GameContext -> unit
program : AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Appends a service-registration callback invoked by the windowed hosts
after core services (assets, input) are registered but before
|
Full Usage:
AdaptiveProgram.withUpdate update program
Parameters:
AdaptiveContext -> GameTime -> unit
program : AdaptiveProgram<'Frame>
Returns: AdaptiveProgram<'Frame>
Modifiers: inline Type parameters: 'Frame |
Sets the per-frame phase of the program.
|
Mibo