[][src]Function gvr_sys::gvr_controller_create_and_init

pub unsafe extern "C" fn gvr_controller_create_and_init(
    options: i32,
    context: *mut gvr_context
) -> *mut gvr_controller_context

Creates and initializes a gvr_controller_context instance which can be used to invoke the Daydream Controller API functions. Important: after creation the API will be in the paused state (the controller will be inactive). You must call gvr_controller_resume() explicitly (typically, in your Android app's onResume() callback).

@param options The API options. To get the defaults, use gvr_controller_get_default_options(). @param context The GVR Context object to sync with (optional). This can be nullptr. If provided, the context's state will be synchronized with the controller's state where possible. For example, when the user recenters the controller, this will automatically recenter head tracking as well. WARNING: the caller is responsible for making sure the pointer remains valid for the lifetime of this object. @return A pointer to the initialized API, or NULL if an error occurs.