WVR_GetVkImage

WVR_EXPORT VkImage WVR_GetVkImage(WVR_TextureQueueHandle_t handle, int32_t index)

Get the VkImage of given index in the given texture queue.

The index number must not be larger than the value returned from WVR_GetTextureQueueLength

This function must be called after WVR_RenderInit.

Return
The desired VkImage.
Version
API Level 3
Parameters
  • handle: The texture queue handle returned by WVR_ObtainTextureQueue
  • index: The index of the VkImage in the queue.

How to use

Here is an example for the function:

// Get the recommended texture size.
WVR_GetRenderTargetSize(&mRenderWidth, &mRenderHeight);

// Get the texture queue handler.
void* leftEyeQ = WVR_ObtainTextureQueue(WVR_TextureTarget_VULKAN, WVR_TextureFormat_RGBA, WVR_TextureType_UnsignedByte, mRenderWidth, mRenderHeight, 0);
void* rightEyeQ = WVR_ObtainTextureQueue(WVR_TextureTarget_VULKAN, WVR_TextureFormat_RGBA, WVR_TextureType_UnsignedByte, mRenderWidth, mRenderHeight, 0);

// Get the available texture index in texture queue.
int32_t indexLeft = WVR_GetAvailableTextureIndex(leftEyeQ);
int32_t indexRight = WVR_GetAvailableTextureIndex(rightEyeQ);

// Get the VkImage with the given index.
VkImage imageLeft = WVR_GetVkImage(leftEyeQ, indexLeft);
VkImage imageRight = WVR_GetVkImage(rightEyeQ, indexRight);