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
State
Gets the current state of the host
HostState State { get; }
Property Value
Methods
InitializeAsync(CancellationToken)
Initializes the host asynchronously
ValueTask InitializeAsync(CancellationToken ct = default)
Parameters
ct
CancellationTokenCancellation 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
stringThe root directory for content loading
ct
CancellationTokenCancellation 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
TimeSpanFixed time step for the game loop
ct
CancellationTokenCancellation 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
IInputDeviceThe input device instance to use
SetRenderer(IRenderer)
Sets the renderer for the host to use for drawing operations
void SetRenderer(IRenderer renderer)
Parameters
renderer
IRendererThe renderer instance to use
StartAsync(CancellationToken)
Starts the host and begins the game loop
Task StartAsync(CancellationToken ct = default)
Parameters
ct
CancellationTokenCancellation 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
CancellationTokenCancellation token
Returns
- Task
A Task representing the stop operation