-
Notifications
You must be signed in to change notification settings - Fork 0
providers
Interhaptics Docs Section: Key Concepts
This module contains the functions related to providers.
This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.
- interhaptics_providers_init
- interhaptics_providers_available
- interhaptics_providers_clean
- interhaptics_providers_render_haptics
This function handles the initialisation process of the specific device's COM, its haptic settings for rendering and subscription to the Interhaptics Engine. It returns a bitmask with bits set or unset for every provider in INTERHAPTICS_PROVIDER, depending on whether it was initialised or not.
To check if a specific provider is initialised:
var _init_mask = interhaptics_providers_init();
if ((_init_mask & INTERHAPTICS_PROVIDER.SENSA) != 0)
{
// Sensa has been initialised
}
Syntax:
interhaptics_providers_init()
Returns:
This function checks the availability of the device before triggering haptic playback. It returns a bitmask with bits set or unset for every provider in INTERHAPTICS_PROVIDER, depending on whether it is available or not.
This optional step can help improve performance.
Syntax:
interhaptics_providers_available()
Returns:
This function is responsible for de-initialising the device's COM, if necessary, and for unsubscribing the provider from the Interhaptics Engine. It returns a bitmask with bits set or unset for every provider in INTERHAPTICS_PROVIDER, depending on whether de-initialisation succeeded for the provider or not.
Syntax:
interhaptics_providers_clean()
Returns:
This function triggers the rendering process for all initialised providers by retrieving the necessary haptic buffers, transcoding them if required, and playing them back on the associated device. It is mandatory to call interhaptics_compute_all_events from the Interhaptics Engine before calling interhaptics_providers_render_haptics for synchronized haptic rendering. Typically, both APIs are implemented in the same loop, with interhaptics_compute_all_events called before the interhaptics_providers_render_haptics calls.
Syntax:
interhaptics_providers_render_haptics()
Returns:
N/A
GameMaker 2024