WVR_SetOverfillRatio

WVR_EXPORT void WVR_SetOverfillRatio(float ratioX, float ratioY)

Function to set the ratio for overfill.

The texture and mesh size may be larger than the actual display size and may result in a decrease in the black area during the ATW process. The implementation treats the x and y directions as equal ratios. If the passed in ratioX and ratioY are different, the smaller value will be used. This function should be invoked after the VR runtime initialization and before the render runtime initialization. This sequence helps prepare the prerequisite data in a suitable environment.

Version
API Level 3
Parameters
  • ratioX: The scale ratio of width (≥ 1.0).
  • ratioY: The scale ratio of height (≥ 1.0).

How to use

Here is an example for the function:

eError = WVR_Init(WVR_AppType_VRContent);
LOGI("initVR():start call WVR_Init end");
if (eError != WVR_InitError_None) {
    LOGE("Unable to initialize VR runtime: %s", WVR_GetInitErrorString(eError));
    return false;
}

WVR_InputAttribute inputIdAndTypes[] = {
    {WVR_InputId_Alias1_Menu, WVR_InputType_Button, WVR_AnalogType_None},
    {WVR_InputId_Alias1_Touchpad, WVR_InputType_Button | WVR_InputType_Touch | WVR_InputType_Analog, WVR_AnalogType_2D},
    {WVR_InputId_Alias1_Trigger, WVR_InputType_Button | WVR_InputType_Touch | WVR_InputType_Analog, WVR_AnalogType_1D},
    {WVR_InputId_Alias1_Digital_Trigger, WVR_InputType_Button | WVR_InputType_Touch | WVR_InputType_Analog, WVR_AnalogType_1D}
};
WVR_SetInputRequest(WVR_DeviceType_HMD, inputIdAndTypes, sizeof(inputIdAndTypes) / sizeof(*inputIdAndTypes));
WVR_SetInputRequest(WVR_DeviceType_Controller_Right, inputIdAndTypes, sizeof(inputIdAndTypes) / sizeof(*inputIdAndTypes));
WVR_SetInputRequest(WVR_DeviceType_Controller_Left, inputIdAndTypes, sizeof(inputIdAndTypes) / sizeof(*inputIdAndTypes));

// Must initialize render runtime before all OpenGL code.
WVR_RenderInitParams_t param;
param = { WVR_GraphicsApiType_OpenGL, WVR_RenderConfig_Default };

float ratio = 1.2f;
// WVR_SetOverfillRatio should be invoked after invoking WVR_Init and before invoking WVR_RenderInit.
WVR_SetOverfillRatio(ratio, ratio);
WVR_RenderError pError = WVR_RenderInit(&param);