WVR_RequestScreenshot¶
- WVR_EXPORT bool WVR_RequestScreenshot(uint32_t width, uint32_t height, WVR_ScreenshotMode mode = WVR_ScreenshotMode_Default, const char * filename = NULL)
Request a screenshot of requested mode.
- Parameters
- width -
Specifies the width of the texture image.
- height -
Specifies the height of the texture image.
- mode -
Specifies requested screenshot mode. The values should be one of WVR_ScreenshotMode.
- filename -
Specifies preferred saving filename. (optional)
- width -
- Return Value
- true -
Succeed to request screenshot.
- false -
Fail to request screenshot.
- true -
Struct and enumeration¶
- enum WVR_ScreenshotMode¶
Screenshot mode.
Enumerate screenshot mode to select stereo scene or single eye image.
Values:
- WVR_ScreenshotMode_Default¶
WVR_ScreenshotMode_Default: Screenshot image is stereo. Just as what is shown on screen
- WVR_ScreenshotMode_Raw¶
WVR_ScreenshotMode_Raw: Screenshot image has only single eye, and without distortion correction
How to use¶
Here is an example for the function:
#include <wvr/wvr_projection.h>
// Take a screen shot of a stereo image.
void StereoScreenShotExample() {
uint32_t width, uint32_t height;
//Function to get the suggested size of render target
WVR_GetRenderTargetSize(&width, &height);
//Function to get the screen shot.
bool result = WVR_RequestScreenshot(width, height, WVR_ScreenshotMode_Default);
}
// Take a screen shot of a single image.
void SingleScreenShotExample() {
uint32_t width, uint32_t height;
//Function to get the suggested size of render target
WVR_GetRenderTargetSize(&width, &height);
//Function to get the screen shot.
bool result = WVR_RequestScreenshot(width, height, WVR_ScreenshotMode_Raw);
}
Screenshot will be saved into the system default screenshot folder. For example, in /sdcard/Pictures/Screenshots for Android.