Function gvr_sys::gvr_controller_state_update [] [src]

pub unsafe extern "C" fn gvr_controller_state_update(
    api: *mut gvr_controller_context,
    controller_index: i32,
    out_state: *mut gvr_controller_state
)

Updates the controller state. Reading the controller state is not a const getter: it has side-effects. In particular, some of the gvr_controller_state fields (the ones documented as "transient") represent one-time events and will be true for only one read operation, and false in subsequent reads.

If the controller_index passed here does not correspond to an available controller (i.e. the controller_index is not in the range [0,N) where N is the number of controllers returned by gvr_controller_get_count), then the values of fields set for the gvr_controller_state instance passed in here are undefined.

The index of each controller device will remain constant the same across controller disconnects/connects during a given VR session. If the underlying set of controllers expected to be available to applications has changed, the gvr_controller_context may no longer be valid, and must be recreated by the applicaion when notified of this.

@param api Pointer to a gvr_controller_context. @param controller_index The index of the controller to update the state from. @param out_state A pointer where the controller's state is to be written. This must have been allocated with gvr_controller_state_create().