WVR_GetTextureQueueLength¶
- WVR_EXPORT uint32_t WVR_GetTextureQueueLength(WVR_TextureQueueHandle_t handle)
Get the length of a texture queue.
- Return
- The length of the queue.
- Parameters
- handle -
The texture queue handle returned by WVR_ObtainTextureQueue
- handle -
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_Timewarp_Asynchronous};
WVR_RenderError pError = WVR_RenderInit(¶m);
if (pError != WVR_RenderError_None) {
LOGE("Render init failed - Error[%d]", pError);
}
std::vector<FrameBufferObject*> LeftEyeFBO;
std::vector<FrameBufferObject*> RightEyeFBO;
FrameBufferObject* fbo;
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);
//Create frame buffer objects
for (int i = 0; i < WVR_GetTextureQueueLength(mLeftEyeQ); i++) {
fbo = new FrameBufferObject((int)WVR_GetTexture(mLeftEyeQ, i).id, RenderWidth, RenderHeight);
LeftEyeFBO.push_back(fbo);
}
for (int j = 0; j < WVR_GetTextureQueueLength(mRightEyeQ); j++) {
fbo = new FrameBufferObject((int)WVR_GetTexture(mRightEyeQ, j).id, RenderWidth, RenderHeight);
RightEyeFBO.push_back(fbo);
}