IApplication
Description
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.
-
IApplicationRunnerConsumer.RunnerAttach: optionally once at application startup.
-
IProfilerConsumer.ProfilerAttach: optionally once at application startup.
-
WindowAttach: once at application startup
-
One or more iterations of the following loop:
-
One iteration of the main loop per frame:
-
IInputConsumer.ConsumeInput: once for each input event
-
WindowSize: once, if the window size has changed since last frame.
-
WindowResolution: once, if the window resolution has changed since the last frame.
-
IRenderable.Render: once
-
-
IProfilerConsumer.ProfilerDetach: optionally once at application shutdown.
-
IApplicationRunnerConsumer.RunnerDetach: optionally once at application shutdown.
-
IDisposable.Dispose: once at application shutdown
The main loop will be run only if there is a valid graphics context.
Public / Methods
GraphicsContextAttach
Attaches the application to its graphics context.
- RenderException
-
If a graphics subsystem error has occurred.
RunOperation
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 cancelled (see RunningOperation.Cancel) and then disposed.
WindowAttach
Attaches the application to its window.
This is always the first callback that the application receives.
WindowResolution
Informs the application about the DPI resolution of its window.
The dpi in value may be used by an application to choose appropriate sizes for fonts, images and other visual resources. Here are some common DPI values:
-
96 DPI - 100% scaling
-
120 DPI - 125% scaling
-
144 DPI - 150% scaling
-
168 DPI - 175% scaling
-
192 DPI - 200% scaling
If the enclosing process is treated as DPI-unaware, an IApplication will see 96 DPI in conjunction with logical screen coordinates and the system will scale the render output automatically.