Header menu logo Mibo

MonoGameProgram Module

MonoGame-specific program builder extensions.

Functions and values

Function or value Description

ofProgram program

Full Usage: ofProgram program

Parameters:
Returns: MonoGameProgram<'Model, 'Msg>

Wraps a Core Program into a MonoGameProgram with no device-level configuration.

program : Program<'Model, 'Msg>
Returns: MonoGameProgram<'Model, 'Msg>

withConfig configure program

Full Usage: withConfig configure program

Parameters:
Returns: MonoGameProgram<'Model, 'Msg>

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

Invoked in the MiboGame constructor, after the Core Program.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 : MonoGameProgram<'Model, 'Msg>
Returns: MonoGameProgram<'Model, 'Msg>
Example

 program
 |> MonoGameProgram.ofProgram
 |> MonoGameProgram.withConfig(fun (game, graphics) ->
     graphics.GraphicsProfile <- GraphicsProfile.HiDef
     graphics.SynchronizeWithVerticalRetrace <- false
     game.IsMouseVisible <- true)

withInputMapper initialMap program

Full Usage: withInputMapper initialMap program

Parameters:
Returns: MonoGameProgram<'Model, 'Msg>

Configures the game to register an IInputMapper service backed by MonoGame's polling API.

This registers IInput automatically (equivalent to Program.withInput).

The mapper is registered as a service via a Program.ServiceRegistrations callback that MiboGame runs before Init, so the Core Program type never references a backend factory.

If you want to stay fully "Elmish" (no service access), consider using InputMapper.subscribe instead and handle a single message.

initialMap : InputMap<'Action>
program : MonoGameProgram<'Model, 'Msg>
Returns: MonoGameProgram<'Model, 'Msg>
Example

 program
 |> MonoGameProgram.ofProgram
 |> MonoGameProgram.withInputMapper inputMap

Type something to start searching.