WVR_ShowPassthroughOverlay¶
-
WVR_EXPORT bool WVR_ShowPassthroughOverlay(bool show, bool delaySubmit = false, bool showIndicator = false)
Function to show the passthrough overlay.
Use this function to also decide whether the passthrough overlay should be shown 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. Calling this API on render thread is not recommended due to IPC with Passthrough service.
- Parameters
show
: Show or hide passthrough overlay. The system passthrough(surrounding or out-of-boundary) would be disabled if the param show is true.delaySubmit
: Delay the return of WVR_SubmitFrame() when the passthrough overlay is showing to improve the latency. default: falseshowIndicator
: Show or hide the controller indicator on passthrough overlay, default: false.
- Return Value
true
: The setting is valid.false
: The setting is invalid.
How to use¶
The following example shows the passthrough overlay:
#include <wvr/wvr_system.h>
bool gShowPassthroughAvailable = true;
bool gDelaySubmit = false;
bool gShowPassthroughControllerIndicator = false;
void pollEvent() {
WVR_Event_t event;
while(WVR_PollEventQueue(&event)) {
if (event.common.type == WVR_EventType_PassthroughOverlayShownBySystem) {
gShowPassthroughAvailable = false;
} else if (event.common.type == WVR_EventType_PassthroughOverlayHiddenBySystem) {
gShowPassthroughAvailable = true;
showPassthrough();
}
}
}
void showPassthrough() {
uint64_t support = WVR_GetSupportedFeatures();
if (support & WVR_SupportedFeature_PassthroughOverlay && gShowPassthroughAvailable) {
WVR_ShowPassthroughOverlay(true, gDelaySubmit, gShowPassthroughControllerIndicator);
}
}