Engine API
| Home | About XEngine | Engine API | SceneGraph | Changelog | Programming Guide |
Index| Configuration API | Device API | Engine Initialization API | Engine Management API | Settings API | Timer API | Utilities API | |
Engine Device API
| Description: | The Device API is responsible for managing input devices in an abstract manner. The input devices (such as mouse, keyboard, game controller) are registered externally via OS dependent input APIs (such as DirectInput or Win32 for Windows) and are not handled explicitly within the engine. The Device API serves as a mapping from the external environment to the engine's internal abstract device specification. Each device need to be registered and the event changes are submitted on appropriate intervals. A device needs to be registered with an id (for single input applications passing 0 will suffice) and then the device needs to be attached to the appropriate SceneGraph API input node |
| Special notes: | This API should be called before XE_engine_initialize |
Function List
| Name | XE_device_register |
| Arguments | int device_id |
| Return Type | void |
| Description | Registers a device with the associated id. The user is responsible for handling input and then passing it on to the engine's device information. For single input applications passing 0 will suffice. Parameters: - device_id, the device id (use 0 for a single input configuration) |
Notes: | This function should be called before XE_engine_initialize |
| Name | XE_device_set_max_values |
| Arguments | int device_id, int num_buttons, int num_axes |
| Return Type | void |
| Description | Sets the maximum number of buttons (e.g. mouse buttons) and axes (as provided in the XE_INPUT_AXIS enum) for each device id. For mouse-keyboard configurations, num_buttons and num_axes should be 5. Parameters: - device_id, the device id - num_buttons, the maximum number of buttons for this device (Default value is 5) - num_axes, the maximum number of axes for this device (Default value is 5) |
Notes: | enum XE_INPUT_AXIS { XIA_MOVE_X, XIA_MOVE_Y, XIA_MOVE_Z, XIA_ROT_X, XIA_ROT_Y }; This function should be called before XE_engine_initialize |
| Name | XE_device_set_axis |
| Arguments | int device_id, int axis_id, float val |
| Return Type | void |
| Description | Sets a specific axis information for the device Parameters: - device_id, the device id - axis_id, the axis id - val, the normalized axis value between -1 and 1 (for keyboard configurations, this should be 1.0 or -1.0) |
Notes: | This function should be called before XE_engine_update |
| Name | XE_device_set_button_pressed |
| Arguments | int device_id, int button_id, bool state |
| Return Type | void |
| Description | Sets a specific button information for the device Parameters: - device_id, the device id - button_id, the button id - state, a flag indicating whether this button is in pressed mode |
Notes: | This function should be called before XE_engine_update |
Last updated 27 May. 2013