Function gvr_sys::gvr_set_default_viewer_profile [] [src]

pub unsafe extern "C" fn gvr_set_default_viewer_profile(
    gvr: *mut gvr_context,
    viewer_profile_uri: *const c_char
) -> bool

Sets the default viewer profile specified by viewer_profile_uri. The viewer_profile_uri that is passed in will be ignored if a valid viewer profile has already been stored on the device that the app is running on.

Note: This function has the potential of blocking for up to 30 seconds for each redirect if a shortened URI is passed in as argument. It will try to unroll the shortened URI for a maximum number of 5 times if the redirect continues. In that case, it is recommended to create a separate thread to call this function so that other tasks like rendering will not be blocked on this. The blocking can be avoided if a standard URI is passed in.

@param gvr Pointer to the gvr instance which to set the profile on. @param viewer_profile_uri A string that contains either the shortened URI or the standard URI representing the viewer profile that the app should be using. If the valid viewer profile can be found on the device, the URI that is passed in will be ignored and nothing will happen. Otherwise, gvr will look for the viewer profile specified by viewer_profile_uri, and it will be stored if found. Also, the values will be applied to gvr. A valid standard URI can be generated from this page: https://www.google.com/get/cardboard/viewerprofilegenerator/ @return True if the viewer profile specified by viewer_profile_uri was successfully stored and applied, false otherwise.