WVR_GetRenderProps¶
- 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.
- Parameters
- props -
pointer of struct WVR_RenderProps_t, to aggregate the properties fetched from render runtime.
- props -
- Return Value
- true -
Success to get the render properties.
- false -
Fail to get the render properties, the fetched properties value is invalid.
- true -
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.
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_Timewarp_Asynchronous};
WVR_RenderError pError = WVR_RenderInit(¶m);
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");
}