WVR_SetOverlayFlags¶
-
WVR_EXPORT WVR_OverlayError WVR_SetOverlayFlags(int32_t overlayId, WVR_OverlayFlag flags)
Set the flags to this overlay.
- Return
- This overlay id is valid or not
- Version
- API Level 5
- Parameters
overlayId
: which overlay’s flags should be set.
How to use¶
Here is an example for the function, this example will shows different overlays on both eyes, and the overlay on left eye will does time-warp:
#include <wvr/wvr_overlay.h>
int32_t mLeftEyeOverlayId;
int32_t mRightEyeOverlayId;
void exampleFun() {
uint32_t leftTextureWidth = 100;
uint32_t leftTextureHeight = 100;
WVR_GenOverlay(&mLeftEyeOverlayId);
GLuint leftTextureId = 0;
glGenTextures(1, &leftTextureId);
glBindTexture(GL_TEXTURE_2D, leftTextureId);
...
glBindTexture(GL_TEXTURE_2D, 0);
const WVR_OverlayTexture_t leftTexture = { leftTextureId, leftTextureWidth,
leftTextureHeight };
WVR_SetOverlayTextureId(mLeftEyeOverlayId, &leftTexture);
uint32_t flags = WVR_GetOverlayFlags(mLeftEyeOverlayId);
flags |= WVR_OverlayFlag_EyeLeft;
// this overlay will does time-warp
flags |= WVR_OverlayFlag_Reprojection;
WVR_SetOverlayFlags(mLeftEyeOverlayId, (WVR_OverlayFlag)flags);
uint32_t rightTextureWidth = 100;
uint32_t rightTextureHeight = 100;
WVR_GenOverlay(&mRightEyeOverlayId);
GLuint rightTextureId = 0;
glGenTextures(1, &rightTextureId);
glBindTexture(GL_TEXTURE_2D, rightTextureId);
...
glBindTexture(GL_TEXTURE_2D, 0);
const WVR_OverlayTexture_t rightTexture = { rightTextureId, rightTextureWidth,
rightTextureHeight };
WVR_SetOverlayTextureId(mRightEyeOverlayId, &rightTexture);
flags = WVR_GetOverlayFlags(mRightEyeOverlayId);
flags |= WVR_OverlayFlag_EyeRight;
WVR_SetOverlayFlags(mRightEyeOverlayId, (WVR_OverlayFlag)flags);
WVR_ShowOverlay(mLeftEyeOverlayId);
WVR_ShowOverlay(mRightEyeOverlayId);
}