Skip to content

KernelAPI reference

Class GameScreen

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

The game’s screen while it runs (Screen): the displays, which one the game is on, and the options that can change without restarting. Changes apply where the platform allows; read a property back to see what applies (a browser or phone keeps its own window, a headless run has none).

C#
public sealed class GameScreen

Inheritance

object ← GameScreen

Properties

Adapter

The graphics adapter (GPU) in use where the platform can identify it; null otherwise.

C#
public string? Adapter { get; }

Property Value

string?

CanChange

Whether this platform can change the window and VSync while running (false headless, in browsers and on phones).

C#
public bool CanChange { get; }

Property Value

bool

Current

The options in effect, to save and return from Settings at the next start: the start-only options as the game started, the others as they are now.

C#
public GraphicsSettings Current { get; }

Property Value

GraphicsSettings

Display

The display the game is on, or null when unknown.

C#
public DisplayInfo? Display { get; }

Property Value

DisplayInfo?

Displays

The displays the system reports; empty where the platform cannot tell.

C#
public IReadOnlyList<DisplayInfo> Displays { get; }

Property Value

IReadOnlyList<DisplayInfo>

FrameRateLimit

The most frames per second to draw; 0 for no limit. Applies at once on every platform that runs in real time.

C#
public int FrameRateLimit { get; set; }

Property Value

int

Exceptions

ArgumentOutOfRangeException

The value is negative.

RefreshRate

The refresh rate frames are paced to (the display’s while VSync is on), in hertz; 0 when nothing paces them to a display (VSync off, scripted and headless runs).

C#
public double RefreshRate { get; }

Property Value

double

Renderer

The graphics API in use (“direct3d11”, “opengl”…) where the platform reports it; null otherwise.

C#
public string? Renderer { get; }

Property Value

string?

VSync

Whether frames wait for the display’s refresh. Setting it applies where CanChange; read it back.

C#
public bool VSync { get; set; }

Property Value

bool

WindowMode

The window’s mode. Setting it applies where CanChange; read it back.

C#
public WindowMode WindowMode { get; set; }

Property Value

WindowMode

Methods

MoveToDisplay(int)

Moves the game to display index of Displays; returns whether it applied.

C#
public bool MoveToDisplay(int index)

Parameters

index int

Returns

bool

ToggleFullscreen()

Switches between a window and full screen: through the platform’s display control where it has one, otherwise by asking the platform (ToggleFullscreen; the headless platform counts the request). The engine calls it when the full-screen action is pressed (Fullscreen).

C#
public bool ToggleFullscreen()

Returns

bool

Whether the window’s mode changed through the display control.