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.
public sealed class PlatformProfile : IHostProfileInheritance
Implements
Constructors
PlatformProfile(string, string, Func<PlatformRequest, IPlatform>)
Creates a profile.
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
name is empty.
create is null.
Properties
CheckSupport
Returns why the profile cannot run in this process (system, missing library), or null when it can.
public Func<string?> CheckSupport { get; init; }Property Value
Description
A one-line description for listings.
public string Description { get; }Property Value
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.
public IReadOnlyList<string> GraphicsDevices { get; init; }Property Value
Name
The name hosts select the profile by (compared case-insensitively).
public string Name { get; }Property Value
Replaceable
The parts a host may supply in its request (audio and input by default).
public PlatformParts Replaceable { get; init; }Property Value
UnsupportedReason
Why the profile cannot run in this process, or null when it can; evaluates CheckSupport on each read.
public string? UnsupportedReason { get; }Property Value
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.
public IPlatform Create(PlatformRequest request)Parameters
request PlatformRequest
Returns
ToString()
The profile’s Name.
public override string ToString()