Logo Mibo

AdaptiveMonoGameProgram Module

MonoGame-specific adaptive program builder extensions.

Types

Type Description

BankEntry

One entry of a sound bank: a game-vocabulary key bound to the source that plays under it. The whole bank loads before the program's Init runs.

Functions and values

Function or value Description

ofProgram program

Full Usage: ofProgram program

Parameters:
Returns: AdaptiveMonoGameProgram<'Frame>
Type parameters: 'Frame

Wraps an AdaptiveProgram into an AdaptiveMonoGameProgram with no device-level configuration.

program : AdaptiveProgram<'Frame>
Returns: AdaptiveMonoGameProgram<'Frame>

withBank bank program

Full Usage: withBank bank program

Parameters:
Returns: AdaptiveMonoGameProgram<'Frame>
Type parameters: 'Frame

Configures the game's sound bank: every entry loads before the program's Init runs, so ctx.Audio.play/ctx.Audio.playMusic can start sounds from the first step.

Each entry names its own SourcePipeline for MGCB assets, File for loose files (WAV sound effects; music goes through the platform decoders). List order is load order; a key registered twice keeps the first entry.

The adaptive counterpart of MonoGameProgram.withBank: same entries, same load slot (service registrations run before Init).

bank : BankEntry list
program : AdaptiveMonoGameProgram<'Frame>
Returns: AdaptiveMonoGameProgram<'Frame>
Example

 let mgProgram =
   AdaptiveProgram.mkProgram init update
   |> AdaptiveMonoGameProgram.ofProgram
   |> AdaptiveMonoGameProgram.withBank
     [ Sound("jump", Pipeline "audio/jump")
       Music("overworld", File "music/overworld.ogg") ]
val mgProgram: obj

withConfig configure program

Full Usage: withConfig configure program

Parameters:
Returns: AdaptiveMonoGameProgram<'Frame>
Type parameters: 'Frame

Adds a device-level configuration callback that receives the Game instance and GraphicsDeviceManager for low-level setup.

Invoked in the AdaptiveMonoGameGame constructor, after the Core AdaptiveProgram.withConfig callbacks and before Initialize / GraphicsDevice creation — so settings like GraphicsProfile and PreferredBackBufferWidth/Height take effect.

Use this for properties that require direct GraphicsDeviceManager/Game access: GraphicsProfile, SynchronizeWithVerticalRetrace (vsync), IsFullScreen, HardwareModeSwitch, Window.AllowUserResizing, Content.RootDirectory, etc.

configure : Game * GraphicsDeviceManager -> unit
program : AdaptiveMonoGameProgram<'Frame>
Returns: AdaptiveMonoGameProgram<'Frame>

Type something to start searching.