TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class ObjectList in Tinman.AddOns.Components

A list of child components for providing automatic callbacks for common interfaces.

sealed class ObjectList implements IGraphicsComponent
  IInputConsumerEx
  extends Initializable
  implements IRenderPreparable
  IUpdateableFrameTime

Remarks

Callbacks for IInputConsumer are performed in the order in which the IInputConsumer objects have been added to this list, until an object returns true from ConsumeInput.

There are no automatic callbacks for Render and Render2D, since the issuing of render commands is usually tightly coupled with the render pipeline.

Public / Attributes

LifecycleState

Returns the lifecycle state of this object.

public override property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Initializable.LifecycleState

ShouldCaptureMouse

Should the mouse be captured, because this input consumer only processes relative input?

public property ShouldCaptureMouse { get }
type bool
value true if the mouse should be captured, false if not.
implements IInputConsumerEx.ShouldCaptureMouse

See also:

IApplicationWindow.MouseCaptured

Public / Constructors

ObjectList

Creates a new instance of ObjectList.

public constructor ObjectList ()

Public / Methods

AcquireTry

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.

ConsumeInput

Consumes the given user input event.

public method ConsumeInput (InputEvent inputEvent)
type bool
params inputEvent The user input event.
returns true if the input event has been consumed, false if not.
implements IInputConsumer.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.

  1. FocusGained: gained input focus
  2. Keyboard events:
  3. Mouse events:
    1. MouseEnter
    2. Mouse events:
    3. MouseLeave
  4. FocusLost: lost input focus
  5. Closing: user request to shut down

Dispose

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.

GraphicsAttach

Attaches this component to the given Graphics context.

public method GraphicsAttach (Graphics graphics)
params graphics [not-null] The graphics context.
implements IGraphicsComponent.GraphicsAttach

Remarks:

All graphics-related resources should be created here.

GraphicsDetach

Detaches this user interface component from its Graphics context.

public method GraphicsDetach ()
implements IGraphicsComponent.GraphicsDetach

Remarks:

All graphics-related resources should be disposed here.

GraphicsResize

The screen size has changed.

public method GraphicsResize (Vec2I screenSize)
params screenSize The new screen size, in pixels.
implements IGraphicsComponent.GraphicsResize

Remarks:

The given screen size is equal to the value of ScreenSize of the Graphics object that has been passed to GraphicsAttach earlier.

Initialize

Initializes the object, if necessary

public method Initialize ()
inherited Initializable.Initialize

Remarks:

The Initialize method returns silently if the object is already in the state Initialized.

InputAttach

Attaches this input consumer to the given input state object.

public method InputAttach (IInputState input)
params input [not-null] The input state object.
implements IInputConsumerEx.InputAttach

Remarks:

The input state object provides a snapshot of the input keys and buttons. It should not be used to detect up/down/click events.

InputDetach

Detached this input consumer from its input state object.

public method InputDetach ()
implements IInputConsumerEx.InputDetach

ObjectAdd

Adds an object to this list.

public method ObjectAdd (object obj, ObjectListFlags callbacks = ObjectListFlags.All)
params obj [not-null] The object to add.
  callbacks The callbacks to perform. Defaults to All.

Remarks:

The following callbacks are performed immediately on obj:

  1. Initialize:
    If this object list has been initialized and the lifecycle state of obj is Created (see LifecycleState).
  2. GraphicsAttach:
    GraphicsResize:
    If this object list is currently attached to a graphics object.

ObjectAddOwn

Adds an owned object to this list.

public method ObjectAddOwn ([Owner] IDisposable obj, ObjectListFlags callbacks = ObjectListFlags.All)
params obj [not-null] The object to add.
  callbacks The callbacks to perform. Defaults to All.

Remarks:

The following callbacks are performed immediately on obj:

  1. Initialize:
    If this object list has been initialized and the lifecycle state of obj is Created (see LifecycleState).
  2. GraphicsAttach:
    GraphicsResize:
    If this object list is currently attached to a graphics object.

ObjectRemove

Removes an object from this list.

public method ObjectRemove (object obj)
params obj [not-null] The object to remove.

Remarks:

The following callbacks are performed immediately on obj:

  1. GraphicsDetach:
    If this object list is currently attached to a graphics object.
  2. Dispose:
    If the given object has been added to this object list via ObjectAddOwn.

RenderPrepare

Prepares rendering.

public method RenderPrepare ()
implements IRenderPreparable.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.

UpdateFrameTime

This method is called once per application frame.

public 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.
implements IUpdateableFrameTime.UpdateFrameTime