Application Hook's

The Machinery allows you to hook your code into specific customization points. Those points happen in different phases and have specific purposes. The biggest difference between the Runner and the Editor is that only the customization points differ in the central update loop.

Table of Content

Application Create

Update

Important side note here tm_plugin_tick_i should not be used for gameplay. To manage your gameplay you should rely on the given gameplay hooks:

  • Entity Component Systems
  • Entity Component Engines
  • Simulation Entry

They are the only recommended way of handling gameplay in the Engine.

Note: Plugin reloads only happen if a plugin has been identified as replaced.

Editor

Runner

Project Hooks

Application Shutdown

Overview

InterfaceDescription
TM_DLL_EXPORT void tm_load_plugin(struct tm_api_registry_api *reg, bool load)Entry point for all plugins
tm_plugin_init_iIs typically called as early as possible after all plugins have been loaded. Is not called when a plugin is reloaded.
tm_plugin_set_the_truth_iIs called whenever the "main" Truth of the application changes. The "main" Truth is the primary Truth used for editing data in the application. Under API Review
tm_render_pipeline_vt
tm_the_machinery_project_loaded_iIs called when a project is loaded.
tm_plugin_reload_iIs called whenever plugins are reloaded after the reload finishes.
tm_plugin_tick_iIs typically called as early as possible in the application main loop "tick".
A tab that is registered to tm_tab_vt and has a tm_tab_vt.ui() or tm_tab_vt.hidden_update() function.Interface name for the tab vtable. Any part of the UI that can act as a tab should implement this interface.
tm_entity_register_engines_simulation_i_version Is called at the beginning of a simulation (start up phase) and all Systems / Engines are registered to the entity context. tm_entity_system_i.update() or tm_engine_i.update()Used to register a tm_entity_register_engines_i that should run in simulation mode with. More information in the designated chapter. Entity Component System
tm_entity_register_engines_editor_i_versionUsed to register a tm_entity_register_engines_i that should run in editor mode with.
tm_simulation_entry_i tm_simulation_entry_i.start() tm_simulation_entry_i.tick() tm_simulation_entry_i.stop()The Simulation Entry interface tm_simulation_entry_i makes it possible to choose a point of entry for code that should run while the simulation (simulation tab or runner) is active. More information in the designated chapter. Simulation Entry
tm_the_machinery_project_unloaded_iIs called when a project is unloaded.
tm_the_machinery_project_saved_iIs called when a project is saved.
tm_plugin_shutdown_iIs called when the application shutdowns on all plugins that have an interface registered. Is not called when a plugin is reloaded.