Table of Contents

Interface IGloamHost

Namespace
Gloam.Runtime.Interfaces
Assembly
Gloam.Runtime.dll

Represents the main host interface for the Gloam runtime environment.

public interface IGloamHost : IAsyncDisposable, IDisposable
Inherited Members

Properties

LayerRenderingManager

/// Gets the layer rendering manager responsible for managing and rendering layers

ILayerRenderingManager LayerRenderingManager { get; }

Property Value

ILayerRenderingManager

State

Gets the current state of the host

HostState State { get; }

Property Value

HostState

Methods

InitializeAsync(CancellationToken)

Initializes the host asynchronously

ValueTask InitializeAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Cancellation token

Returns

ValueTask

A ValueTask representing the initialization operation

LoadContentAsync(string, CancellationToken)

Loads content from the specified root directory

ValueTask LoadContentAsync(string contentRoot, CancellationToken ct = default)

Parameters

contentRoot string

The root directory for content loading

ct CancellationToken

Cancellation token

Returns

ValueTask

A ValueTask representing the content loading operation

RunAsync(Func<bool>, TimeSpan, CancellationToken)

Runs the game loop with the specified timing and condition

Task RunAsync(Func<bool> keepRunning, TimeSpan fixedStep, CancellationToken ct)

Parameters

keepRunning Func<bool>

Function that returns true while the game should continue running

fixedStep TimeSpan

Fixed time step for the game loop

ct CancellationToken

Cancellation token

Returns

Task

A Task representing the game loop execution

SetInputDevice(IInputDevice)

Sets the input device for the host to use for user input

void SetInputDevice(IInputDevice inputDevice)

Parameters

inputDevice IInputDevice

The input device instance to use

SetRenderer(IRenderer)

Sets the renderer for the host to use for drawing operations

void SetRenderer(IRenderer renderer)

Parameters

renderer IRenderer

The renderer instance to use

StartAsync(CancellationToken)

Starts the host and begins the game loop

Task StartAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Cancellation token

Returns

Task

A Task representing the start operation

StopAsync(CancellationToken)

Stops the host and game loop gracefully

Task StopAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Cancellation token

Returns

Task

A Task representing the stop operation