Class VRScreenshots
- java.lang.Object
-
- org.lwjgl.openvr.VRScreenshots
-
public class VRScreenshots extends java.lang.ObjectAllows the application to generate screenshots.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intnVRScreenshots_GetScreenshotPropertyFilename(int screenshotHandle, int filenameType, long pchFilename, int cchFilename, long pError)Unsafe version of:GetScreenshotPropertyFilenamestatic intnVRScreenshots_GetScreenshotPropertyType(int screenshotHandle, long pError)Unsafe version of:GetScreenshotPropertyTypestatic intnVRScreenshots_HookScreenshot(long pSupportedTypes, int numTypes)Unsafe version of:HookScreenshotstatic intnVRScreenshots_RequestScreenshot(long pOutScreenshotHandle, int type, long pchPreviewFilename, long pchVRFilename)Unsafe version of:RequestScreenshotstatic intnVRScreenshots_SubmitScreenshot(int screenshotHandle, int type, long pchSourcePreviewFilename, long pchSourceVRFilename)Unsafe version of:SubmitScreenshotstatic intnVRScreenshots_TakeStereoScreenshot(long pOutScreenshotHandle, long pchPreviewFilename, long pchVRFilename)Unsafe version of:TakeStereoScreenshotstatic java.lang.StringVRScreenshots_GetScreenshotPropertyFilename(int screenshotHandle, int filenameType, int cchFilename, java.nio.IntBuffer pError)Get the filename for the preview or vr image (seeEScreenshotPropertyFilenames).static intVRScreenshots_GetScreenshotPropertyFilename(int screenshotHandle, int filenameType, java.nio.ByteBuffer pchFilename, java.nio.IntBuffer pError)Get the filename for the preview or vr image (seeEScreenshotPropertyFilenames).static intVRScreenshots_GetScreenshotPropertyType(int screenshotHandle, java.nio.IntBuffer pError)When your application receives aVR.EVREventType_VREvent_RequestScreenshotevent, call these functions to get the details of the screenshot request.static intVRScreenshots_HookScreenshot(java.nio.IntBuffer pSupportedTypes)Called by the running VR application to indicate that it wishes to be in charge of screenshots.static intVRScreenshots_RequestScreenshot(java.nio.IntBuffer pOutScreenshotHandle, int type, java.lang.CharSequence pchPreviewFilename, java.lang.CharSequence pchVRFilename)Request a screenshot of the requested type.static intVRScreenshots_RequestScreenshot(java.nio.IntBuffer pOutScreenshotHandle, int type, java.nio.ByteBuffer pchPreviewFilename, java.nio.ByteBuffer pchVRFilename)Request a screenshot of the requested type.static intVRScreenshots_SubmitScreenshot(int screenshotHandle, int type, java.lang.CharSequence pchSourcePreviewFilename, java.lang.CharSequence pchSourceVRFilename)Submit the completed screenshot.static intVRScreenshots_SubmitScreenshot(int screenshotHandle, int type, java.nio.ByteBuffer pchSourcePreviewFilename, java.nio.ByteBuffer pchSourceVRFilename)Submit the completed screenshot.static intVRScreenshots_TakeStereoScreenshot(java.nio.IntBuffer pOutScreenshotHandle, java.lang.CharSequence pchPreviewFilename, java.lang.CharSequence pchVRFilename)Tells the compositor to take an internal screenshot of typeVR.EVRScreenshotType_VRScreenshotType_Stereo.static intVRScreenshots_TakeStereoScreenshot(java.nio.IntBuffer pOutScreenshotHandle, java.nio.ByteBuffer pchPreviewFilename, java.nio.ByteBuffer pchVRFilename)Tells the compositor to take an internal screenshot of typeVR.EVRScreenshotType_VRScreenshotType_Stereo.static intVRScreenshots_UpdateScreenshotProgress(int screenshotHandle, float flProgress)Call this if the application is taking the screen shot will take more than a few ms processing.
-
-
-
Method Detail
-
nVRScreenshots_RequestScreenshot
public static int nVRScreenshots_RequestScreenshot(long pOutScreenshotHandle, int type, long pchPreviewFilename, long pchVRFilename)Unsafe version of:RequestScreenshot
-
VRScreenshots_RequestScreenshot
public static int VRScreenshots_RequestScreenshot(java.nio.IntBuffer pOutScreenshotHandle, int type, java.nio.ByteBuffer pchPreviewFilename, java.nio.ByteBuffer pchVRFilename) public static int VRScreenshots_RequestScreenshot(java.nio.IntBuffer pOutScreenshotHandle, int type, java.lang.CharSequence pchPreviewFilename, java.lang.CharSequence pchVRFilename)Request a screenshot of the requested type.A request of the
VR.EVRScreenshotType_VRScreenshotType_Stereotype will always work. Other types will depend on the underlying application support.The first file name is for the preview image and should be a regular screenshot (ideally from the left eye). The second is the VR screenshot in the correct format. They should be in the same aspect ratio.
Note that the VR dashboard will call this function when the user presses the screenshot binding (currently System Button + Trigger). If Steam is running, the destination file names will be in %TEMP% and will be copied into Steam's screenshot library for the running application once
SubmitScreenshotis called. If Steam is not running, the paths will be in the user's documents folder under Documents\SteamVR\Screenshots. Other VR applications can call this to initate a screenshot outside of user control. The destination file names do not need an extension, will be replaced with the correct one for the format which is currently .png.- Parameters:
type- one of:
-
nVRScreenshots_HookScreenshot
public static int nVRScreenshots_HookScreenshot(long pSupportedTypes, int numTypes)Unsafe version of:HookScreenshot
-
VRScreenshots_HookScreenshot
public static int VRScreenshots_HookScreenshot(java.nio.IntBuffer pSupportedTypes)
Called by the running VR application to indicate that it wishes to be in charge of screenshots. If the application does not call this, the Compositor will only supportVR.EVRScreenshotType_VRScreenshotType_Stereoscreenshots that will be captured without notification to the running app.Once hooked your application will receive a
VR.EVREventType_VREvent_RequestScreenshotevent when the user presses the buttons to take a screenshot.
-
nVRScreenshots_GetScreenshotPropertyType
public static int nVRScreenshots_GetScreenshotPropertyType(int screenshotHandle, long pError)Unsafe version of:GetScreenshotPropertyType
-
VRScreenshots_GetScreenshotPropertyType
public static int VRScreenshots_GetScreenshotPropertyType(int screenshotHandle, java.nio.IntBuffer pError)When your application receives aVR.EVREventType_VREvent_RequestScreenshotevent, call these functions to get the details of the screenshot request.
-
nVRScreenshots_GetScreenshotPropertyFilename
public static int nVRScreenshots_GetScreenshotPropertyFilename(int screenshotHandle, int filenameType, long pchFilename, int cchFilename, long pError)Unsafe version of:GetScreenshotPropertyFilename
-
VRScreenshots_GetScreenshotPropertyFilename
public static int VRScreenshots_GetScreenshotPropertyFilename(int screenshotHandle, int filenameType, @Nullable java.nio.ByteBuffer pchFilename, java.nio.IntBuffer pError) public static java.lang.String VRScreenshots_GetScreenshotPropertyFilename(int screenshotHandle, int filenameType, int cchFilename, java.nio.IntBuffer pError)Get the filename for the preview or vr image (seeEScreenshotPropertyFilenames).- Parameters:
filenameType- one of:VR.EVRScreenshotPropertyFilenames_VRScreenshotPropertyFilenames_PreviewVR.EVRScreenshotPropertyFilenames_VRScreenshotPropertyFilenames_VR- Returns:
- the size of the string
-
VRScreenshots_UpdateScreenshotProgress
public static int VRScreenshots_UpdateScreenshotProgress(int screenshotHandle, float flProgress)Call this if the application is taking the screen shot will take more than a few ms processing. This will result in an overlay being presented that shows a completion bar.
-
nVRScreenshots_TakeStereoScreenshot
public static int nVRScreenshots_TakeStereoScreenshot(long pOutScreenshotHandle, long pchPreviewFilename, long pchVRFilename)Unsafe version of:TakeStereoScreenshot
-
VRScreenshots_TakeStereoScreenshot
public static int VRScreenshots_TakeStereoScreenshot(java.nio.IntBuffer pOutScreenshotHandle, java.nio.ByteBuffer pchPreviewFilename, java.nio.ByteBuffer pchVRFilename) public static int VRScreenshots_TakeStereoScreenshot(java.nio.IntBuffer pOutScreenshotHandle, java.lang.CharSequence pchPreviewFilename, java.lang.CharSequence pchVRFilename)Tells the compositor to take an internal screenshot of typeVR.EVRScreenshotType_VRScreenshotType_Stereo. It will take the current submitted scene textures of the running application and write them into the preview image and a side-by-side file for the VR image.This is similiar to request screenshot, but doesn't ever talk to the application, just takes the shot and submits.
-
nVRScreenshots_SubmitScreenshot
public static int nVRScreenshots_SubmitScreenshot(int screenshotHandle, int type, long pchSourcePreviewFilename, long pchSourceVRFilename)Unsafe version of:SubmitScreenshot
-
VRScreenshots_SubmitScreenshot
public static int VRScreenshots_SubmitScreenshot(int screenshotHandle, int type, java.nio.ByteBuffer pchSourcePreviewFilename, java.nio.ByteBuffer pchSourceVRFilename) public static int VRScreenshots_SubmitScreenshot(int screenshotHandle, int type, java.lang.CharSequence pchSourcePreviewFilename, java.lang.CharSequence pchSourceVRFilename)Submit the completed screenshot.If Steam is running this will call into the Steam client and upload the screenshot to the screenshots section of the library for the running application. If Steam is not running, this function will display a notification to the user that the screenshot was taken. The paths should be full paths with extensions.
File paths should be absolute including extensions.
screenshotHandlecan beVR.k_unScreenshotHandleInvalidif this was a new shot taking by the app to be saved and not initiated by a user (achievement earned or something).- Parameters:
type- one of:
-
-