WVR_GetRenderTargetSize

WVR_EXPORT void WVR_GetRenderTargetSize(uint32_t * width, uint32_t * height)

Function to get the suggested size of render target.

This API provides render target size to fit display.

Parameters
  • width -

    suggested width for the offscreen render target

  • height -

    suggested height for the offscreen render target

How to use

Here is an example for the function:

std::vector<FrameBufferObject*> LeftEyeFBO;
std::vector<FrameBufferObject*> RightEyeFBO;
FrameBufferObject* fbo;
int QueueLength = 10;

uint32_t RenderWidth = 0, RenderHeight = 0;

WVR_GetRenderTargetSize(&RenderWidth, &RenderHeight);

//Get the texture queue handler
void* mLeftEyeQ = WVR_ObtainTextureQueue(WVR_TextureTarget_2D, WVR_TextureFormat_RGBA, WVR_TextureType_UnsignedByte, RenderWidth, RenderHeight, 0);
void* mRightEyeQ = WVR_ObtainTextureQueue(WVR_TextureTarget_2D, WVR_TextureFormat_RGBA, WVR_TextureType_UnsignedByte, RenderWidth, RenderHeight, 0);

for (int i = 0; i < QueueLength; i++) {
    fbo = new FrameBufferObject((int)WVR_GetTexture(mLeftEyeQ, i).id, RenderWidth, RenderHeight);
    LeftEyeFBO.push_back(fbo);

    fbo = new FrameBufferObject((int)WVR_GetTexture(mRightEyeQ, i).id, RenderWidth, RenderHeight);
    RightEyeFBO.push_back(fbo);
}