WVR_SetPassthroughOverlayAlpha¶
-
WVR_EXPORT WVR_Result WVR_SetPassthroughOverlayAlpha(const float alpha)
Function to check if the passthrough overlay is showing or not.
This function must be called after calling WVR_RenderInit().
- Version
- API Level 8
- Note
- Supported from Runtime version 7 or higher (certain devices only). Make sure the target device supports passthrough overlay by calling WVR_GetSupportedFeatures() and checking WVR_SupportedFeature_PassthroughOverlay.
- Parameters
alpha
: is the alpha factor in range 0.0 to 1.0.
- Return Value
WVR_SUCCESS
: The setting is valid.WVR_Error_RuntimeVersionNotSupport
: This feature is supported from Runtime version 7 or higher.WVR_Error_FeatureNotSupport
: This feature is not supported on this device.
How to use¶
The following example to set the alpha of the passthrough overlay:
#include <wvr/wvr_system.h>
bool gShowPassthroughAvailable = true;
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);
WVR_SetPassthroughOverlayAlpha(0.5f);
}
}