WVR_SetPassthroughImageRate

WVR_EXPORT WVR_Result WVR_SetPassthroughImageRate(WVR_PassthroughImageRate rate)

Function to set passthrough image’s refresh rate. The API adjusts the refresh rate of passthourgh image to the WaveVR Runtime, Affects the WVR_ShowPassthroughOverlay(), WVR_ShowPassthroughUnderlay and WVR_ShowProjectedPassthrough.

Version
API Level 15
Note
Supported since Runtime version 15 or higher.
Parameters
Return Value
  • WVR_SUCCESS: if the setting of passthrough image’s rate mode is successful.
  • WVR_Error_SystemInvalid: if the initialization has not finished yet. You may try this API later.
  • WVR_Error_FeatureNotSupport: if this feature is not support on this device or service.
  • WVR_Error_RuntimeVersionNotSupport: if the runtime version is too old to support the function call.

How to use

The following example shows how to specify the image rate for the underlay passthrough:

#include <wvr/wvr_system.h>

void showPassthrough() {
    uint64_t support = WVR_GetSupportedFeatures();
    if (support & WVR_SupportedFeature_PassthroughOverlay) {
        // Check result and cache current mode to prevent call this API every frame
        // and cause CPU runtime bottleneck.
        auto result = WVR_SetPassthroughImageRate(WVR_PassthroughImageRate_Boost);
        WVR_ShowPassthroughUnderlay(true);
    }
}