WVR_IsPassthroughOverlayVisible

WVR_EXPORT bool WVR_IsPassthroughOverlayVisible()

Function to check if the passthrough overlay is showing or not.

This function must be called after calling WVR_RenderInit().

Version
API Level 5
Note
Supported from Runtime version 5 or higher (certain devices only). Make sure the target device supports passthrough overlay by calling WVR_GetSupportedFeatures() and checking WVR_SupportedFeature_PassthroughOverlay.
Return Value
  • true: The passthrough overlay is showing.
  • false: The passthrough overlay is not showing.

How to use

The following example shows the passthrough overlay by WVR_IsPassthroughOverlayVisible() if the user pulls the trigger on the controller:

#include <wvr/wvr_system.h>

bool gIsPassthroughOverlayServiceAvailable = false;

void pollEvent() {
    WVR_Event_t event;
    while(WVR_PollEventQueue(&event)) {
        if (event.common.type == WVR_EventType_PassthroughOverlayResumed) {
            gIsPassthroughOverlayServiceAvailable = true;
        } else if (event.common.type == WVR_EventType_PassthroughOverlaySuspended) {
            gIsPassthroughOverlayServiceAvailable = false;
        } else if (event.common.type == WVR_EventType_ButtonUnpressed) {
            if (event.input.inputId == WVR_InputId_Alias1_Trigger) {
                showPassthrough();
            }
        }
    }
}

void showPassthrough() {
    uint64_t support = WVR_GetSupportedFeatures();
    if (support & WVR_SupportedFeature_PassthroughOverlay && gIsPassthroughOverlayServiceAvailable) {
        if (!WVR_IsPassthroughOverlayVisible()) {
            WVR_ShowPassthroughOverlay(true);
        }
    }
}