Skip to content

Class PlatformHost

Namespace: Apogee.Platform
Assembly: Apogee.Platform.dll

The process-wide platform layer over SDL: its lifetime, the event pump and the windows it dispatches window events to. Everything here runs on the main thread, as SDL requires.

public static class PlatformHost

Inheritance

object ← PlatformHost

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Properties

IsInitialized

public static bool IsInitialized { get; }

Property Value

bool

QuitRequested

True once the user or the system asked the application to quit (SDL_EVENT_QUIT); see .

public static bool QuitRequested { get; }

Property Value

bool

VideoDriver

The name of the video driver in use ("wayland", "x11", "windows", "cocoa", "dummy"…), or null before .

public static string? VideoDriver { get; }

Property Value

string?

Methods

ClearQuitRequest()

public static void ClearQuitRequest()

Initialize(string?)

Initializes SDL's video, event and gamepad systems. videoDriver forces a driver; the tests use "dummy", which has windows but no display. Calling it again while initialized does nothing.

public static void Initialize(string? videoDriver = null)

Parameters

videoDriver string?

PumpEvents()

Processes every pending event: window events update their , sees all of them.

public static void PumpEvents()

SetAppMetadata(string, string, string)

Tells SDL what the application is called, before : the name the platform shows (the macOS menu, audio mixers), the version, and the reverse-DNS identifier that Wayland uses as the window's application id (so that a desktop entry of the same name finds its icon) and that PulseAudio and PipeWire use for the stream. Failing is only logged.

public static void SetAppMetadata(string name, string version, string identifier)

Parameters

name string

version string

identifier string

Shutdown()

Quits SDL. Destroy the windows first.

public static void Shutdown()

RawEvent

public static event RawEventCallback? RawEvent

Event Type

RawEventCallback?