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_arena.h>

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

void pollEvent() {
    WVR_Event_t event;
    while(WVR_PollEventQueue(&event)) {
        if (event.common.type == WVR_EventType_ButtonUnpressed) {
            if (event.input.inputId == WVR_InputId_Alias1_Trigger) {
                showPassThrough();
            }
        }
    }
}

void main() {
    WVR_RenderError pError = WVR_RenderInit(&param);
    pollEvent();
}