KernelAPI reference
Interface IPlatform
Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Backends and platforms
Everything a backend provides: the host (IPlatformHost: clock, events, main surface, capabilities, whether it may block) plus, until the graphics, input and audio contracts are split from it, the renderer that draws into the virtual canvas and the graphics, input and audio devices.
public interface IPlatform : IPlatformHost, IDisposableImplements
Remarks
Optional features are capabilities found with TryGetCapability``1, never by casting a platform: IDisplayControl, IPlatformDiagnostics, ITouchScreen (with its vibration), IDisplayPacing and IPreciseDelay. A platform that wraps another forwards every member, so wrapping never hides a capability.
Properties
Audio
Plays sound; a silent device when there is no audio.
IAudioDevice Audio { get; }Property Value
Graphics
Creates textures.
IGraphicsDevice Graphics { get; }Property Value
Input
Keyboard, gamepad and pointer state, read once per update.
IInputSource Input { get; }Property Value
Letterbox
Colour of the window around the frame. Starts as Letterbox; the start screen sets its own colour while it shows. Platforms without a window keep it and ignore it.
Color Letterbox { get; set; }Property Value
Methods
BeginFrame()
Starts a frame and returns the renderer that draws into the virtual canvas.
IRenderer BeginFrame()Returns
EndFrame()
Finishes the frame and presents it.
void EndFrame()SaveScreenshot(string)
Writes the most recently completed virtual frame as a PNG.
void SaveScreenshot(string path)Parameters
path string
ToggleFullscreen()
Switches between window and full screen where the platform has a window; does nothing elsewhere.
void ToggleFullscreen()