Skip to content

KernelAPI reference

Class PlatformProfile

Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Backends and platforms

A named way to build an IPlatform: an official backend (“sdl”, “raylib”, “headless”) or one a developer registers. The profile decides which parts a host may replace (Replaceable), because some subsystems share state with the window and cannot be swapped independently.

C#
public sealed class PlatformProfile : IHostProfile

Inheritance

object ← PlatformProfile

Implements

IHostProfile

Constructors

PlatformProfile(string, string, Func<PlatformRequest, IPlatform>)

Creates a profile.

C#
public PlatformProfile(string name, string description, Func<PlatformRequest, IPlatform> create)

Parameters

name string

The name hosts select it by, case-insensitive; must not be empty.

description string

One line shown by –list-platforms.

create Func<PlatformRequest, IPlatform>

Builds the platform for a request.

Exceptions

ArgumentException

name is empty.

ArgumentNullException

create is null.

Properties

CheckSupport

Returns why the profile cannot run in this process (system, missing library), or null when it can.

C#
public Func<string?> CheckSupport { get; init; }

Property Value

Func<string?>

Description

A one-line description for listings.

C#
public string Description { get; }

Property Value

string

GraphicsDevices

The graphics devices a request may name in Device (compared case-insensitively), the platform’s default first; empty (the default) when the platform has only its own device, which a request then selects by leaving Device null.

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

Property Value

IReadOnlyList<string>

Name

The name hosts select the profile by (compared case-insensitively).

C#
public string Name { get; }

Property Value

string

Replaceable

The parts a host may supply in its request (audio and input by default).

C#
public PlatformParts Replaceable { get; init; }

Property Value

PlatformParts

UnsupportedReason

Why the profile cannot run in this process, or null when it can; evaluates CheckSupport on each read.

C#
public string? UnsupportedReason { get; }

Property Value

string?

Methods

Create(PlatformRequest)

Builds the platform for request. The supplied parts (Audio, ExtraInput) are composed into the backend when it is built, never by wrapping it, so the platform returned is the backend itself with all its capabilities. Throws PlatformConfigurationException for a request the profile cannot honour, and when the backend did not use the parts the request supplied.

C#
public IPlatform Create(PlatformRequest request)

Parameters

request PlatformRequest

Returns

IPlatform

ToString()

The profile’s Name.

C#
public override string ToString()

Returns

string