WVR_SetOverlayTextureId

WVR_EXPORT WVR_OverlayError WVR_SetOverlayTextureId(int32_t overlayId, const WVR_OverlayTexture_t * texture)

Set texture id which generated by user.

Return
The error code of set texture id.
Version
API Level 1
Parameters
  • overlayId: which overlay should be control.
  • texture: which contained Texture’s infomation, textureId/width and height.

How to use

Here is an example for the function:

#include <wvr/wvr_overlay.h>
int32_t mOverlayId;

void exampleFun() {
    uint32_t textureWidth = 100;
    uint32_t textureHeight = 100;
    WVR_GenOverlay(&mOverlayId);
    GLuint textureId = 0;
    glGenTextures(1, &textureId);
    glBindTexture(GL_TEXTURE_2D, textureId);
    ...
    glBindTexture(GL_TEXTURE_2D, 0);
    const WVR_OverlayTexture_t texture = { textureId, textureWidth,
                                          textureHeight };
    WVR_SetOverlayTextureId(mOverlayId, &texture);
    WVR_DelOverlay(mOverlayId);
}