Skip to content

KernelAPI reference

Class GraphicsSettings

Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Game lifecycle and time

The graphics options a game starts with (Graphics). Every option has a sensible automatic default; the launcher’s options (–platform, –renderer, –vsync, –fps-limit, –gpu, –window, –display) override them for one run, and Screen changes the ones a platform can change while the game runs. A game that offers a graphics menu saves Current and returns it from Settings at its next start. VSync, the frame limit and UpdateRate are independent: VSync waits for the display, the limit caps frames per second, the update rate is the simulation’s.

C#
public sealed record GraphicsSettings : IEquatable<GraphicsSettings>

Inheritance

object ← GraphicsSettings

Implements

IEquatable<GraphicsSettings>

Constructors

GraphicsSettings()

C#
public GraphicsSettings()

Properties

Backend

The platform to run on first (“sdl”, “raylib”, “sdl-software”…); null tries the catalog in order. A platform that cannot start here falls back to the next one, saying why; a platform named on the command line does not. Read at start only.

C#
public string? Backend { get; init; }

Property Value

string?

Device

The graphics device to draw with, on platforms that offer more than one (GraphicsDevices): SDL offers “sdl-renderer” (its default, tier 0) and “sdl-gpu” (tier 1: custom shaders, depth, the 3D path). Null (the default) keeps the platform’s default device. A platform that does not offer the named device refuses to start with PlatformConfigurationException, and one that offers it but cannot open it here says why; the game never runs on another device silently. The launcher’s –graphics overrides it. Read at start only.

C#
public string? Device { get; init; }

Property Value

string?

Display

The display to open on (an index of Displays); null lets the system choose. An index the system does not have is ignored.

C#
public int? Display { get; init; }

Property Value

int?

FrameRateLimit

The most frames per second to draw; 0 (the default) sets no limit. Independent of VSync: with VSync off it paces frames on its own; with VSync on, a limit below the display’s rate skips refreshes (choose a divisor of the display’s rate, or draw with FrameBlend). Not applied to fixed-step (scripted) runs.

C#
public int FrameRateLimit { get; init; }

Property Value

int

Gpu

Which GPU to ask for on a machine with two (GpuPreference). Read at start only.

C#
public GpuPreference Gpu { get; init; }

Property Value

GpuPreference

Renderers

Graphics APIs to try in order on platforms that offer several (SDL: “direct3d11”, “direct3d12”, “vulkan”, “opengl”, “metal”, “gpu”…); after them, the platform chooses as when the list is empty (the default). Names the system lacks are skipped. Read at start only.

C#
public IReadOnlyList<string> Renderers { get; init; }

Property Value

IReadOnlyList<string>

VSync

Whether frames wait for the display’s refresh (true by default): no tearing, and frames paced to the display.

C#
public bool VSync { get; init; }

Property Value

bool

WindowMode

Windowed (the default), borderless full screen, or exclusive full screen. Phones and browsers decide this themselves.

C#
public WindowMode WindowMode { get; init; }

Property Value

WindowMode

Methods

<Clone>$()

C#
public GraphicsSettings <Clone>$()

Returns

GraphicsSettings

Equals(object?)

C#
public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(GraphicsSettings?)

C#
public bool Equals(GraphicsSettings? other)

Parameters

other GraphicsSettings?

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(GraphicsSettings?, GraphicsSettings?)

C#
public static bool operator ==(GraphicsSettings? left, GraphicsSettings? right)

Parameters

left GraphicsSettings?

right GraphicsSettings?

Returns

bool

operator !=(GraphicsSettings?, GraphicsSettings?)

C#
public static bool operator !=(GraphicsSettings? left, GraphicsSettings? right)

Parameters

left GraphicsSettings?

right GraphicsSettings?

Returns

bool