Files
mrgameeng/src/MrGameEng.Host/GameHostOptions.cs
T
Leonid PershinandClaude Fable 5 2ac074004a
CI / build-test (push) Successful in 1m24s
Split the platform out of Core: new Host library + HeadlessHost
Core now depends only on Friflo.Engine.ECS — no MonoGame, no platform.
The windowed MonoGame host moves to the new MrGameEng.Host library:
GameHost, GameHostOptions, visual scene transitions (OverlayTransition,
Transitions.Fade/Wipe, TransitionRenderer) and the Input feature
(namespace MrGameEng.Input is unchanged). Transition timing stays in
Core (SceneManager exposes ActiveTransition/TransitionCoverage/
TransitionPhase; the host draws the overlay). EngineContext loses its
GraphicsDevice property: hosts publish the device as a service and
graphics code reads it via context.GetGraphicsDevice() in Graphics.

Core gains HeadlessHost: a fixed-timestep loop without a window or GPU
(Tick/RunTicks, Run with wall-clock pacing and lag resync) for dedicated
servers, batch simulation and tests. Graphics and Audio now carry their
own MonoGame.Framework.DesktopGL reference instead of inheriting it
from Core.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 23:04:34 +03:00

35 lines
1.2 KiB
C#

using Microsoft.Xna.Framework;
namespace MrGameEng.Host;
/// <summary>Window and loop settings for <see cref="GameHost"/>.</summary>
public sealed class GameHostOptions
{
/// <summary>Window title.</summary>
public string Title { get; set; } = "MrGameEng";
/// <summary>Backbuffer width in pixels.</summary>
public int Width { get; set; } = 1280;
/// <summary>Backbuffer height in pixels.</summary>
public int Height { get; set; } = 720;
/// <summary>Borderless fullscreen instead of a window.</summary>
public bool Fullscreen { get; set; }
/// <summary>Synchronize presentation with the display's vertical retrace.</summary>
public bool VSync { get; set; } = true;
/// <summary>Run updates on a fixed timestep (<see cref="TargetFps"/>) instead of as fast as possible.</summary>
public bool FixedTimeStep { get; set; }
/// <summary>Target update rate when <see cref="FixedTimeStep"/> is enabled.</summary>
public int TargetFps { get; set; } = 60;
/// <summary>Color the backbuffer is cleared to each frame.</summary>
public Color ClearColor { get; set; } = Color.CornflowerBlue;
/// <summary>Allow the user to resize the window.</summary>
public bool AllowResizing { get; set; } = true;
}