Inno.Adapter.Presentation
Section titled “Inno.Adapter.Presentation”
- A neutral, application-owned presentation context for authoring products.
A neutral, application-owned presentation context for authoring products.
Start with owning windows and surfaces and presentation context ownership.
Create one owned context
Section titled “Create one owned context”PresentationBackendId is an open, case-sensitive identity; the default struct is unassigned. Composition explicitly supplies the complete provider set. The catalog freezes it, rejects invalid/duplicate/null providers and reports supportedBackends without creating a native context. Unknown IDs fail with NotSupportedException; null products fail with InvalidOperationException.
CreateContext returns a caller-owned IPresentationContext. PresentationBackendOptions borrows the platform application, primary window and render device and requests neutral feature flags. It contains no shader compiler or asset source. The context must retire before its shared device and window owners. DefaultAuthoringAdapterCatalog requires an explicit non-null presentationProviders sequence; an empty sequence registers none. It does not silently select ImGui for null input.
Frame, layout and viewport operations
Section titled “Frame, layout and viewport operations”RenderFrame selects its owned context and display metrics, optionally runs synchronous prepareFrame, then invokes the draw callback. A preparation failure prevents drawing and partial publication. A null draw callback or overlapping operation fails explicitly. The context also contributes draw work through the neutral RenderGraph contract.
TryGetWindowId resolves only a live platform window for a presentation viewport. SetLayoutFile(null) disables backend file persistence when the host saves layout text itself. LoadLayout consumes complete text; TryCaptureLayout returns a complete snapshot when dirty or explicitly forced. Host layout persistence remains separate from frame drawing.
Texture lifetime
Section titled “Texture lifetime”RegisterTexture accepts a texture owned by the active render-device generation and returns an opaque presentation token. UnregisterTexture releases that registration without releasing the source texture; it reports whether a registration existed. DrawImage uses logical presentation units. Do not persist tokens, use them after their presentation generation retires or free a source texture while a draw can still consume it.
Editor hosts retain this neutral context, not SDL windows, BGFX handles or a concrete ImGui context. Concrete event bridges and renderers belong to composition/backend implementations.
Host usage
Section titled “Host usage”Supply existing live dependencies. This example checks the host contract; it does not initialize a complete product or certify a physical device.
using Inno.Adapter.Presentation;
static IPresentationContext CreateOwnedPresentation( IPresentationBackendFactory factory, PresentationBackendId selection, PresentationBackendOptions options) { return factory.CreateContext(selection, options);}Source boundary
Section titled “Source boundary”The source project defines the selected host declarations. Script projection and platform execution require their separate evidence.
API reference
Section titled “API reference”Source project facts
Section titled “Source project facts”Project: Inno.Adapter.Presentation
Source: src/adapters/presentation/Inno.Adapter.Presentation/Inno.Adapter.Presentation.csproj
| Type | API | Description |
|---|---|---|
| IAuthoringAdapterCatalog | engine | Extends the runtime adapter catalog with tooling and presentation factories required by authoring products. |
| IPresentationBackendFactory | engine | Creates host presentation contexts from explicit backend selections. |
| IPresentationContext | engine | Defines the backend-neutral lifecycle used by a graphical composition host. |
| PresentationBackendCatalog | engine | Resolves presentation providers from one immutable, composition-owned registration snapshot. |
| PresentationBackendId | engine | Identifies a presentation implementation without closing the set of supported backends. |
| PresentationBackendOptions | engine | Collects the validated presentation backend options values that configure one owned operation. |
| PresentationBackendProvider | engine | Describes an explicitly composed host presentation implementation and its creation boundary. |
| PresentationFeatures | engine | Describes optional capabilities requested from a host presentation backend. |
| PresentationTextureHandle | engine | Identifies a renderer-owned texture through an opaque host-presentation token. |