An implementation of the IApplication interface that renders the Tinman 3D logo.
sealed class
|
LogoApplication
|
extends
|
ApplicationBase
|
This application is used as a placeholder.
Returns the configuration value that describes this object.
public
virtual
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
The configuration value. | |
inherited
|
ApplicationBase.ToConfig
|
Remarks:
All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.
The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.
Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.
Optional limit for rendering frames.
public
virtual
property
|
FrameRateLimit
{
get
}
|
||
type
|
int32
|
||
value
|
|
The
frame
rate
limit,
in
Hz.
If
0
the
limit
will
be
disabled. |
|
inherited
|
ApplicationBase.FrameRateLimit
|
Remarks:
Defaults
to
100
.
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
Acquires a strong reference to this disposable object.
[OwnerReturn, ThreadSafe]
|
||||
public
method
|
AcquireTry
()
|
|||
type
|
IDisposable
|
|||
returns
|
this
if
a
new
strong
reference
has
been
acquired,
null
if
this
object
is
already
being
disposed.
|
|||
inherited
|
Disposable.AcquireTry
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Consumes the given user input event.
public
virtual
method
|
ConsumeInput
(InputEvent inputEvent)
|
||
type
|
bool
|
||
params
|
inputEvent
|
The user input event. | |
returns
|
true
if
the
input
event
has
been
consumed,
false
if
not. |
||
inherited
|
ApplicationBase.ConsumeInput
|
Remarks:
Input events are provided to an IInputConsumer object only if it has the input focus (see FocusGained and FocusLost). Mouse events are provided when the mouse cursor is inside of the input bounds (MouseEnter and MouseLeave). The Closing event can be provided at any time.
Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
Attaches the application to its graphics context.
public
virtual
method
|
GraphicsContextAttach
(IGraphicsContext context)
|
||
params
|
context
|
[not-null]
|
The graphics context. |
inherited
|
ApplicationBase.GraphicsContextAttach
|
Detaches the application from its graphics context.
public
virtual
method
|
GraphicsContextDetach
()
|
||
inherited
|
ApplicationBase.GraphicsContextDetach
|
Is the given keyboard key pressed down?
[Pure]
|
||||
public
method
|
IsDown
(KeyboardKey key)
|
|||
type
|
bool
|
|||
params
|
key
|
The keyboard key. | ||
returns
|
true
if
the
key
is
pressed
down,
false
if
not. |
|||
inherited
|
ApplicationBase.IsDown
|
Is the given mouse button pressed down?
[Pure]
|
||||
public
method
|
IsDown
(MouseButton button)
|
|||
type
|
bool
|
|||
params
|
button
|
The mouse button. | ||
returns
|
true
if
the
button
is
pressed
down,
false
if
not. |
|||
inherited
|
ApplicationBase.IsDown
|
Performs rendering.
public
override
method
|
Render
()
|
||
overrides
|
ApplicationBase.Render
|
Remarks:
Implementing methods must not assume that any specific render state is in place when being called. Instead, the implementing method is responsible for setting up all state that is required for rendering.
Usually, implementing classes receive their current graphics context directly or indirectly from GraphicsContextAttach or GraphicsAttach.
In order to maximize parallelism between the CPU and GPU, only actual rendering (using the current graphics context) should be performed here. All other preparation resp. setup should be done in RenderPrepare instead.
See also:
IApplication.GraphicsContextAttachPrepares rendering.
public
virtual
method
|
RenderPrepare
()
|
||
inherited
|
ApplicationBase.RenderPrepare
|
Remarks:
This method is called before Render, when the graphics context has not yet begun to render the scene.
All setup work that does not require a graphics context (e.g. matrix computation, per-frame visibility determination) should be done here. This can help to maximize parallelism between the CPU and the GPU.
Runs the given operation within the lifecycle of this application.
public
method
|
RunOperation
([Owner]
IOperation operation)
|
||
type
|
RunningOperation
|
||
params
|
operation
|
[not-null]
|
The operation to run. |
returns
|
|
The running operation. | |
inherited
|
ApplicationBase.RunOperation
|
Remarks:
The Update method is called from within the applications 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 Cancel) and then disposed.
Provides runtime performance statistics to the application.
public
virtual
method
|
Statistics
(ApplicationStats stats)
|
||
params
|
stats
|
The performance statistic values. | |
inherited
|
ApplicationBase.Statistics
|
Remarks:
This information is gathered by the application loop which is running the application.
Calling this method is optional. Implementations of IApplication must never depend on the availability of ApplicationStats values.
This method is called once per application frame.
public
virtual
method
|
UpdateFrameTime
(float32 time)
|
||
type
|
bool
|
||
params
|
time
|
[>0]
|
The amount of time that has elapsed since the last frame, in seconds. |
returns
|
true
if
the
object
needs
to
be
presented
again,
false
if
the
current
presentation
is
still
valid.
|
||
inherited
|
ApplicationBase.UpdateFrameTime
|
Attaches the application to its window.
public
virtual
method
|
WindowAttach
(IApplicationWindow window)
|
||
params
|
window
|
[not-null]
|
The application window. |
inherited
|
ApplicationBase.WindowAttach
|
Remarks:
This is always the first callback that the application receives.
Informs the application about the client size of its window.
public
virtual
method
|
WindowSize
(Vec2I clientSize)
|
||
params
|
clientSize
|
The client size of the application window. | |
inherited
|
ApplicationBase.WindowSize
|