WVR_EXPORT bool WVR_GetRenderProps(WVR_RenderProps_t * props)

Requests the properties from render runtime.

The interface fetch necessary properties from render runtime. The output argument WVR_RenderProps_t* carries the frame rate and the existing status of the external display. The corresponding member value can be access via dereferencing the interface parameter referring to WVR_RenderProps_t. Return value is the validness of properties. If it is not true, it means the fetched value is not available. Please note that some platforms return false rather than fetching render properties.

API Level 1
  • props: pointer of struct WVR_RenderProps_t, to aggregate the properties fetched from render runtime.
Return Value
  • true: Success to get the render properties.
  • false: Fail to get the render properties, the fetched properties value is invalid.

Struct and enumeration

The srtuct WVR_RenderProps is defined as below.

struct WVR_RenderProps

Render properties.

Aggregate the propertie values from runtime via API WVR_GetRenderProps.

Public Members

float refreshRate

The refresh rate is the number of frame shown in a second.

bool hasExternal

To probe whether the present display is an external device.

float ipdMeter

The presumed interpupillary distance of HMD user, measured in meters.

How to use

Here is an example for the function:

#include <wvr/wvr_render.h>

// Must initialize render runtime once before calling all rendering-related API.
WVR_RenderInitParams_t param = {WVR_GraphicsApiType_OpenGL, WVR_RenderConfig_Default};
WVR_RenderError pError = WVR_RenderInit(&param);
if (pError != WVR_RenderError_None) {
    LOGE("Render init failed - Error[%d]", pError);

// Get the properties from the render runtime.
WVR_RenderProps_t props;
bool result = WVR_GetRenderProps(&props);
if (result == true) {
    LOGI("FPS(%.3f); External device exists(%s)", props.refreshRate, props.hasExternal ? "YES" : "NO");