IApplication

Description

interface Tinman.Engine.Application.IApplication

Base interface for interactive real-time applications that are run by an ApplicationLoop.

The following methods will never be called from more than one thread at a time.

The main loop will be run only if there is a valid graphics context.

Public / Methods

GraphicsContextAttach


public method GraphicsContextAttach → (1)

context in : IGraphicsContext

[not-null]
The graphics context.

Attaches the application to its graphics context.

RenderException

If a graphics subsystem error has occurred.

GraphicsContextDetach


public method GraphicsContextDetach → ()

Detaches the application from its graphics context.

RunOperation


public method RunOperation → (1)

operation in : IOperation

[not-null]
The operation to run.

returns → RunningOperation

The running operation.

Runs the given operation within the lifecycle of this application.

The RunningOperation.Update method is called from within the applications IUpdateableFrameTime.UpdateFrameTime method.

The returned RunningOperation can be used to track progress resp. errors and to cancel the running operation.

When the application is disposed, all running operations are canceled (see RunningOperation.Cancel) and then disposed.

WindowAttach


public method WindowAttach → (1)

window in : IApplicationWindow

[not-null]
The application window.

Attaches the application to its window.

This is always the first callback that the application receives.

WindowSize


public method WindowSize → (1)

clientSize in : Vec2I

The client size of the application window.

Informs the application about the client size of its window.

Extensions

Run

2 overloads


[OwnerThis]
public static method Run1 → (4)

source in : string

[not-empty]
The error source to use in case an exception is thrown.

context in : IGraphicsContextFactory

[not-null]
The graphics context factory to use.

window in : IApplicationWindow

[not-null]
The application window to use.

sleepOnIdle in : bool

Honor ApplicationLoopResult.Idle by sleeping for a short time?

returns → TinmanError

The error in case of a crash, null if the application has ended normally.

Runs this application.


[OwnerThis]
public static method Run2 → (4)

source in : string

[not-empty]
The error source to use in case an exception is thrown.

contexts in : IVectorConst<IGraphicsContextFactory>

[not-empty]
The graphics context factories to use.

window in : IApplicationWindow

[not-null]
The application window to use.

sleepOnIdle in : bool

Honor ApplicationLoopResult.Idle by sleeping for a short time?

returns → TinmanError

The error in case of a crash, null if the application has ended normally.

Runs this application.