Header menu logo Mibo

MonoGameGameContext Module

Typed accessors for the MonoGame handles registered in a Core GameContext.

The MonoGame host registers GraphicsDevice, ContentManager, and Game into the Core service registry (mirroring how the raylib backend registers IInput/IAssets). These accessors retrieve them with the same getService/tryGetService semantics as other services.

Functions and values

Function or value Description

getContentManager ctx

Full Usage: getContentManager ctx

Parameters:
Returns: ContentManager

Gets the registered ContentManager.

ctx : GameContext
Returns: ContentManager
Exception Thrown if not registered (the host must call register first).

getGame ctx

Full Usage: getGame ctx

Parameters:
Returns: Game

Gets the registered Game instance.

ctx : GameContext
Returns: Game
Exception Thrown if not registered (the host must call register first).

getGraphicsDevice ctx

Full Usage: getGraphicsDevice ctx

Parameters:
Returns: GraphicsDevice

Gets the registered GraphicsDevice.

ctx : GameContext
Returns: GraphicsDevice
Exception Thrown if not registered (the host must call register first).

register game ctx

Full Usage: register game ctx

Parameters:

Registers the host game's GraphicsDevice, ContentManager, and the Game itself into the GameContext.

Called once by MiboGame after the GraphicsDevice is created and before ElmishLoop.Init, so user init code can resolve every MonoGame handle.

game : Game
ctx : GameContext

tryGetContentManager ctx

Full Usage: tryGetContentManager ctx

Parameters:
Returns: ContentManager voption

Returns the registered ContentManager, or ValueNone.

ctx : GameContext
Returns: ContentManager voption

tryGetGame ctx

Full Usage: tryGetGame ctx

Parameters:
Returns: Game voption

Returns the registered Game instance, or ValueNone.

ctx : GameContext
Returns: Game voption

tryGetGraphicsDevice ctx

Full Usage: tryGetGraphicsDevice ctx

Parameters:
Returns: GraphicsDevice voption

Returns the registered GraphicsDevice, or ValueNone.

ctx : GameContext
Returns: GraphicsDevice voption

Type something to start searching.