WVR_ReleaseTextureQueue

WVR_EXPORT void WVR_ReleaseTextureQueue(WVR_TextureQueueHandle_t handle)

Release a texture queue.

Version
API Level 1
Parameters
  • handle: The handle of the texture queue to be released.

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

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

//Delete frame buffer objects
if (mLeftEyeQ != 0) {
    for (int i = 0; i < QueueLength; i++) {
        delete LeftEyeFBO.at(i);
    }
}
//Release texture queue
WVR_ReleaseTextureQueue(mLeftEyeQ);

//Delete frame buffer objects
if (mRightEyeQ != 0) {
    for (int i = 0; i < QueueLength; i++) {
        delete LeftEyeFBO.at(i);
    }
}
//Release texture queue
WVR_ReleaseTextureQueue(mRightEyeQ);