WVR_IsRendererRenderingΒΆ

WVR_EXPORT bool WVR_IsRendererRendering()

Check whether the direct mode is still working.

Runtime will clear the callback set when it is going to terminate the invoking delegation. Check existence of callback function set in runtime. If the renderer is null then return false. If on the contrary then returning true. This function is used to handle the life cycle of the native activity in the main loop. The render thread is held in runtime. Activity can proceed to terminating state when the render thread is going to put an end to the process.

Version
API Level 1
Return Value
  • true: callback set is still presence in runtime.
  • false: callback set is no longer existing in runtime.

How to useΒΆ

Here is an example for the function:

// 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);
}

WVR_StereoRenderer_t renderer;
renderer.graphics_init = &CustGLInit;
renderer.pre_draw_frame = &CustPreDrawFrame;
renderer.draw_eye = &CustDrawEye;
renderer.post_draw_frame = &CustPostDrawFrame;

WVR_StartRenderer(&renderer);
while (WVR_IsRendererRendering()) {
    sleep(1);
}
LOGD("Renderer is terminated");