TNI Controls Interface

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(Created page with "TNIControls is a builtin TNILibrary within Trainz which allows controls plugin assets to communicate their control input to Trainz. These commands...")
 
Line 1: Line 1:
 
TNIControls is a builtin TNILibrary within Trainz which allows [[KIND tni-controls-plugin|controls plugin]] assets to communicate their control input to Trainz. These commands can then be bound to in-game functions by the player, via the standard control settings UI.
 
TNIControls is a builtin TNILibrary within Trainz which allows [[KIND tni-controls-plugin|controls plugin]] assets to communicate their control input to Trainz. These commands can then be bound to in-game functions by the player, via the standard control settings UI.
  
This subsystem is part of [[TrainzNativeInterface]], the core of which is further detailed [[TNI Core Interface|here]].
+
Before continuing, it is recommended you first familiarise yourself with the following pages:
 +
* [[TrainzNativeInterface]] - For an overview of TNI and the associated licensing requirements
 +
* [[TNI Core Interface]] - For details of the core TNI functionality, object types, etc.
 +
* [[KIND tni-controls-plugin]] - For the specification of the controls plugin asset kind.
  
''This page is a work in progress, and reflects technologies which are not yet present in retail versions of Trainz.''
+
''NOTE: This page is a work in progress, and reflects technologies which are not yet present in retail versions of Trainz.''
 +
 
 +
==Overview==
 +
TNIControls is a singleton system within Trainz native code. It is initialised at game startup (if supported by the install, and enabled by the player), and will automatically locate and load any installed TNI controls plugin assets. Such assets will then have their plugin DLLs loaded into the same TNIContext as TNIControls itself, where the plugins can locate hardware devices, register them, and provide control inputs.
 +
 
 +
TNIControls itself is entirely thread safe, and may be loaded and called at any time from within a controls plugin DLL, using the [[TNI_Core_Interface#TNIContext|TNIGetContextLibrary]] function. The specific function calls supported by TNIControls are detailed in the next section.
 +
 
 +
==TNIControls Library Calls==

Revision as of 13:52, 22 November 2017

TNIControls is a builtin TNILibrary within Trainz which allows controls plugin assets to communicate their control input to Trainz. These commands can then be bound to in-game functions by the player, via the standard control settings UI.

Before continuing, it is recommended you first familiarise yourself with the following pages:

* TrainzNativeInterface - For an overview of TNI and the associated licensing requirements
* TNI Core Interface - For details of the core TNI functionality, object types, etc.
* KIND tni-controls-plugin - For the specification of the controls plugin asset kind.

NOTE: This page is a work in progress, and reflects technologies which are not yet present in retail versions of Trainz.

Overview

TNIControls is a singleton system within Trainz native code. It is initialised at game startup (if supported by the install, and enabled by the player), and will automatically locate and load any installed TNI controls plugin assets. Such assets will then have their plugin DLLs loaded into the same TNIContext as TNIControls itself, where the plugins can locate hardware devices, register them, and provide control inputs.

TNIControls itself is entirely thread safe, and may be loaded and called at any time from within a controls plugin DLL, using the TNIGetContextLibrary function. The specific function calls supported by TNIControls are detailed in the next section.

TNIControls Library Calls

Personal tools