Class OVR
- java.lang.Object
-
- org.lwjgl.ovr.OVR
-
public class OVR extends java.lang.ObjectNative bindings to libOVR, using the Oculus SDK C API.Overview of the API:
Setup
InitializeCreate(&hmd, &graphicsId)- Use hmd members and
GetFovTextureSizeto determine graphics configuration andGetRenderDescto get per-eye rendering parameters. - Allocate texture swap chains with
ovr_CreateTextureSwapChainDX()orCreateTextureSwapChainGL. Create any associated render target views or frame buffer objects.
Application Loop
- Call
GetPredictedDisplayTimeto get the current frame timing information. - Call
GetTrackingStateandCalcEyePosesto obtain the predicted rendering pose for each eye based on timing. - Render the scene content into the current buffer of the texture swapchains for each eye and layer you plan to update this frame. If you render into
a texture swap chain, you must call
CommitTextureSwapChainon it to commit the changes before you reference the chain this frame (otherwise, your latest changes won't be picked up). - Call
SubmitFrameto render the distorted layers to and present them on the HMD. IfSubmitFramereturnsSuccess_NotVisible, there is no need to render the scene for the next loop iteration. Instead, just callSubmitFrameagain until it returnsSuccess.
Shutdown
-
-
Field Summary
Fields Modifier and Type Field and Description static intOVR_FORMAT_B4G4R4A4_UNORM
OVR_FORMAT_B5G5R5A1_UNORM
OVR_FORMAT_B5G6R5_UNORMNot currently supported on PC.static intOVR_FORMAT_B8G8R8A8_UNORMThe format of a texture.static intOVR_FORMAT_B8G8R8A8_UNORM_SRGB
OVR_FORMAT_B8G8R8X8_UNORM
OVR_FORMAT_B8G8R8X8_UNORM_SRGBNot supported for OpenGL applications.static intOVR_FORMAT_D16_UNORM
OVR_FORMAT_D24_UNORM_S8_UINT
OVR_FORMAT_D32_FLOAT
OVR_FORMAT_D32_FLOAT_S8X24_UINT
OVR_FORMAT_R16G16B16A16_FLOAT
OVR_FORMAT_R8G8B8A8_UNORM
OVR_FORMAT_R8G8B8A8_UNORM_SRGB
OVR_FORMAT_UNKNOWNThe format of a texture.static intovrButton_AButton Astatic intovrButton_BButton Bstatic intovrButton_BackButton Backstatic intovrButton_DownButton Downstatic intovrButton_EnterButton Enterstatic intovrButton_HomeButton Homestatic intovrButton_LeftButton Leftstatic intovrButton_LMaskBit mask of all buttons on the left Touch controllerstatic intovrButton_LShoulderButton LShoulderstatic intovrButton_LThumbButton LThumbstatic intovrButton_PrivateButton input types.static intovrButton_RightButton Rightstatic intovrButton_RMaskBit mask of all buttons on the right Touch controllerstatic intovrButton_RShoulderButton RShoulderstatic intovrButton_RThumbButton RThumbstatic intovrButton_UpButton Upstatic intovrButton_VolDownButton VolDownstatic intovrButton_VolUpButton VolUpstatic intovrButton_XButton Xstatic intovrButton_YButton Ystatic intovrControllerType_ActiveOperate on or query whichever controller is active.static intovrControllerType_LTouch
ovrControllerType_None
ovrControllerType_Remote
ovrControllerType_RTouch
ovrControllerType_Touch
ovrControllerType_XBoxWhich controller is connected; multiple can be connected at once.static intovrDebugHudStereo_CrosshairAtInfinity
ovrDebugHudStereo_Off
ovrDebugHudStereo_Quad
ovrDebugHudStereo_QuadWithCrosshairVisual properties of the stereo guide.static intovrEye_LeftThe left eye, from the viewer's perspective.static intovrEye_RightThe right eye, from the viewer's perspective.static intovrFalseBoolean valuesstatic intovrHand_Left
ovrHand_RightNames for the left and right hand array indexes.static intovrHmd_CB
ovrHmd_CV1
ovrHmd_DK1
ovrHmd_DK2
ovrHmd_DKHD
ovrHmd_E3_2015
ovrHmd_ES06
ovrHmd_ES09
ovrHmd_ES11
ovrHmd_None
ovrHmd_OtherHMD types.static intovrHmdCap_DebugDevice(read only) Specifies that the HMD is a virtual debug device.static intovrInit_DebugWhen a debug library is requested, a slower debugging version of the library will run which can be used to help solve problems in the library and debug application code.static intovrInit_RequestVersionWhen a version is requested, the LibOVR runtime respects theRequestedMinorVersionfield and verifies that theRequestedMinorVersionis supported.static intovrInit_WritableBitsThese bits are writable by user code.static intovrLayerFlag_HeadLockedMark this surface as "headlocked", which means it is specified relative to the HMD and moves with it, rather than being specified relative to sensor/torso space and remaining still while the head moves.static intovrLayerFlag_HighQualityEnables 4x anisotropic sampling during the composition of the layer.static intovrLayerFlag_TextureOriginAtBottomLeftthe opposite is TopLeft.static intovrLayerHud_InfoShows info about a specific layerstatic intovrLayerHud_OffTurns off the layer HUDstatic intovrLayerType_DisabledLayer is disabled.static intovrLayerType_EyeFovDescribed byOVRLayerEyeFov.static intovrLayerType_EyeMatrixDescribed byOVRLayerEyeMatrix.static intovrLayerType_QuadDescribed byOVRLayerQuad.static intovrLogLevel_DebugDebug-level log event.static intovrLogLevel_ErrorError-level log event.static intovrLogLevel_InfoInfo-level log event.static intovrMaxLayerCountSpecifies the maximum number of layers supported bySubmitFrame.static intovrPerfHud_AppRenderTimingShows render timing info for applicationstatic intovrPerfHud_CompRenderTimingShows render timing info for OVR compositorstatic intovrPerfHud_LatencyTimingShows latency related timing infostatic intovrPerfHud_OffTurns off the performance HUDstatic intovrPerfHud_PerfSummaryShows performance summary and headroomstatic intovrPerfHud_VersionInfoShows SDK & HMD version Infostatic intovrStatus_OrientationTrackedOrientation is currently tracked (connected and in use).static intovrStatus_PositionTrackedPosition is currently tracked (false if out of range).static intovrTexture_2D2D texturesstatic intovrTexture_2D_ExternalExternal 2D texture.static intovrTexture_CubeCube maps.static intovrTextureBind_DX_DepthStencilThe chain buffers can be bound as depth and/or stencil buffersstatic intovrTextureBind_DX_RenderTargetThe application can write into the chain with pixel shaderstatic intovrTextureBind_DX_UnorderedAccessThe application can write to the chain with compute shaderstatic intovrTextureBind_NoneThe bindings required for texture swap chain.static intovrTextureMisc_AllowGenerateMipsDX only: Allow generation of the mip chain on the GPU via the GenerateMips call.static intovrTextureMisc_DX_TypelessDX only: The underlying texture is created with a TYPELESS equivalent of the format specified in the texture desc.static intovrTextureMisc_NoneMisc flags overriding particular behaviors of a texture swap chain.static intovrTextureMisc_ProtectedContentTexture swap chain contains protected content, and requires HDCP connection in order to display to HMD.static intovrTouch_ATouch Astatic intovrTouch_BTouch Bstatic intovrTouch_LButtonMaskBit mask of all the button touches on the left controllerstatic intovrTouch_LIndexPointingTouch LIndexPointingstatic intovrTouch_LIndexTriggerTouch LIndexTriggerstatic intovrTouch_LPoseMaskBit mask of all left controller poses.static intovrTouch_LThumbTouch LThumbstatic intovrTouch_LThumbUpTouch LThumbUpstatic intovrTouch_RButtonMaskBit mask of all the button touches on the right controllerstatic intovrTouch_RIndexPointingTouchRIndexPointingstatic intovrTouch_RIndexTriggerTouch RIndexTriggerstatic intovrTouch_RPoseMaskBit mask of all right controller posesstatic intovrTouch_RThumbTouch RThumbstatic intovrTouch_RThumbUpTouch RThumbUpstatic intovrTouch_XTouch Xstatic intovrTouch_YTouch Ystatic intovrTracker_ConnectedThe sensor is present, else the sensor is absent or offline.static intovrTracker_PoseTrackedThe sensor has a valid pose, else the pose is unavailable.static intovrTrackingCap_MagYawCorrectionSupports yaw drift correction via a magnetometer or other means.static intovrTrackingCap_OrientationSupports orientation tracking (IMU).static intovrTrackingCap_PositionSupports positional tracking.static intovrTrackingOrigin_EyeLevelTracking system origin reported at eye (HMD) height.static intovrTrackingOrigin_FloorLevelTracking system origin reported at floor height.static intovrTrueBoolean values
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidovr_ClearShouldRecenterFlag(long session)Clears the ShouldRecenter status bit in ovrSessionStatus.static intovr_CommitTextureSwapChain(long session, long chain)Commits any pending changes to anovrTextureSwapChain, and advances its current index.static intovr_Create(PointerBuffer pSession, OVRGraphicsLuid luid)Creates a handle to a VR session.static voidovr_Destroy(long session)Destroys the HMD.static voidovr_DestroyMirrorTexture(long session, long mirrorTexture)Destroys a mirror texture previously created by one of the mirror texture creation functions.static voidovr_DestroyTextureSwapChain(long session, long chain)Destroys anovrTextureSwapChainand frees all the resources associated with it.static booleanovr_GetBool(long session, java.nio.ByteBuffer propertyName, boolean defaultVal)Reads a boolean property.static booleanovr_GetBool(long session, java.lang.CharSequence propertyName, boolean defaultVal)Reads a boolean property.static intovr_GetConnectedControllerTypes(long session)Returns controller types connected to the system OR'ed together.static floatovr_GetFloat(long session, java.nio.ByteBuffer propertyName, float defaultVal)Reads a float property.static floatovr_GetFloat(long session, java.lang.CharSequence propertyName, float defaultVal)Reads a float property.static intovr_GetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values)Array version of:GetFloatArraystatic intovr_GetFloatArray(long session, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values)Reads a float array property.static intovr_GetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)Array version of:GetFloatArraystatic intovr_GetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)Reads a float array property.static OVRSizeiovr_GetFovTextureSize(long session, int eye, OVRFovPort fov, float pixelsPerDisplayPixel, OVRSizei __result)Calculates the recommended viewport size for rendering a given eye within the HMD with a given FOV cone.static OVRHmdDescovr_GetHmdDesc(long session, OVRHmdDesc __result)Returns information about the current HMD.static intovr_GetInputState(long session, int controllerType, OVRInputState inputState)Returns the most recent input state for controllers, without positional tracking info.static intovr_GetInt(long session, java.nio.ByteBuffer propertyName, int defaultVal)Reads an integer property.static intovr_GetInt(long session, java.lang.CharSequence propertyName, int defaultVal)Reads an integer property.static voidovr_GetLastErrorInfo(OVRErrorInfo errorInfo)Returns information about the most recent failed return value by the current thread for this library.static doubleovr_GetPredictedDisplayTime(long session, long frameIndex)Gets the time of the specified frame midpoint.static OVREyeRenderDescovr_GetRenderDesc(long session, int eyeType, OVRFovPort fov, OVREyeRenderDesc __result)Computes the distortion viewport, view adjust, and other rendering parameters for the specified eye.static intovr_GetSessionStatus(long session, OVRSessionStatus sessionStatus)Returns status information for the application.static java.lang.Stringovr_GetString(long session, java.nio.ByteBuffer propertyName, java.nio.ByteBuffer defaultVal)Reads a string property.static java.lang.Stringovr_GetString(long session, java.lang.CharSequence propertyName, java.lang.CharSequence defaultVal)Reads a string property.static intovr_GetTextureSwapChainCurrentIndex(long session, long chain, int[] out_Index)Array version of:GetTextureSwapChainCurrentIndexstatic intovr_GetTextureSwapChainCurrentIndex(long session, long chain, java.nio.IntBuffer out_Index)Gets the current index in anovrTextureSwapChain.static intovr_GetTextureSwapChainDesc(long session, long chain, OVRTextureSwapChainDesc out_Desc)Gets the description of the buffers in anovrTextureSwapChain.static intovr_GetTextureSwapChainLength(long session, long chain, int[] out_Length)Array version of:GetTextureSwapChainLengthstatic intovr_GetTextureSwapChainLength(long session, long chain, java.nio.IntBuffer out_Length)Gets the number of buffers in anovrTextureSwapChain.static doubleovr_GetTimeInSeconds()Returns global, absolute high-resolution time in seconds.static intovr_GetTrackerCount(long session)Returns the number of sensors.static OVRTrackerDescovr_GetTrackerDesc(long session, int trackerDescIndex, OVRTrackerDesc __result)Returns a given sensor description.static OVRTrackerPoseovr_GetTrackerPose(long session, int trackerPoseIndex, OVRTrackerPose __result)Returns theOVRTrackerPosefor the given sensor.static intovr_GetTrackingOriginType(long session)Gets the tracking origin state.static OVRTrackingStateovr_GetTrackingState(long session, double absTime, boolean latencyMarker, OVRTrackingState __result)Returns tracking state reading based on the specified absolute system time.static java.lang.Stringovr_GetVersionString()Returns the version string representing the LibOVRRT version.static intovr_Initialize(OVRInitParams params)Initialize LibOVR for application usage.static intovr_RecenterTrackingOrigin(long session)Re-centers the sensor position and orientation.static booleanovr_SetBool(long session, java.nio.ByteBuffer propertyName, boolean value)Writes or creates a boolean property.static booleanovr_SetBool(long session, java.lang.CharSequence propertyName, boolean value)Writes or creates a boolean property.static intovr_SetControllerVibration(long session, int controllerType, float frequency, float amplitude)Turns on vibration of the given controller.static booleanovr_SetFloat(long session, java.nio.ByteBuffer propertyName, float value)Writes or creates a float property.static booleanovr_SetFloat(long session, java.lang.CharSequence propertyName, float value)Writes or creates a float property.static booleanovr_SetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values)Array version of:SetFloatArraystatic booleanovr_SetFloatArray(long session, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values)Writes or creates a float array property.static booleanovr_SetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)Array version of:SetFloatArraystatic booleanovr_SetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)Writes or creates a float array property.static booleanovr_SetInt(long session, java.nio.ByteBuffer propertyName, int value)Writes or creates an integer property.static booleanovr_SetInt(long session, java.lang.CharSequence propertyName, int value)Writes or creates an integer property.static booleanovr_SetString(long hmddesc, java.nio.ByteBuffer propertyName, java.nio.ByteBuffer value)Writes or creates a string property.static booleanovr_SetString(long hmddesc, java.lang.CharSequence propertyName, java.lang.CharSequence value)Writes or creates a string property.static intovr_SetTrackingOriginType(long session, int origin)Sets the tracking origin type.static voidovr_Shutdown()Shuts down LibOVR.static intovr_SubmitFrame(long session, long frameIndex, OVRViewScaleDesc viewScaleDesc, PointerBuffer layerPtrList)Submits layers for distortion and display.static java.lang.Stringovr_TraceMessage(int level, java.nio.ByteBuffer message)Writes a message string to the LibOVR tracing mechanism (if enabled).static java.lang.Stringovr_TraceMessage(int level, java.lang.CharSequence message)Writes a message string to the LibOVR tracing mechanism (if enabled).
-
-
-
Field Detail
-
ovrFalse
public static final int ovrFalse
Boolean values- See Also:
- Constant Field Values
-
ovrTrue
public static final int ovrTrue
Boolean values- See Also:
- Constant Field Values
-
ovrInit_Debug
public static final int ovrInit_Debug
When a debug library is requested, a slower debugging version of the library will run which can be used to help solve problems in the library and debug application code.- See Also:
- Constant Field Values
-
ovrInit_RequestVersion
public static final int ovrInit_RequestVersion
When a version is requested, the LibOVR runtime respects theRequestedMinorVersionfield and verifies that theRequestedMinorVersionis supported.- See Also:
- Constant Field Values
-
ovrInit_WritableBits
public static final int ovrInit_WritableBits
These bits are writable by user code.- See Also:
- Constant Field Values
-
ovrLogLevel_Debug
public static final int ovrLogLevel_Debug
Debug-level log event.- See Also:
- Constant Field Values
-
ovrLogLevel_Info
public static final int ovrLogLevel_Info
Info-level log event.- See Also:
- Constant Field Values
-
ovrLogLevel_Error
public static final int ovrLogLevel_Error
Error-level log event.- See Also:
- Constant Field Values
-
ovrHmd_None
public static final int ovrHmd_None
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_DK1
public static final int ovrHmd_DK1
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_DKHD
public static final int ovrHmd_DKHD
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_DK2
public static final int ovrHmd_DK2
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_CB
public static final int ovrHmd_CB
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_Other
public static final int ovrHmd_Other
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_E3_2015
public static final int ovrHmd_E3_2015
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_ES06
public static final int ovrHmd_ES06
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_ES09
public static final int ovrHmd_ES09
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_ES11
public static final int ovrHmd_ES11
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmd_CV1
public static final int ovrHmd_CV1
HMD types. (ovrHmdType)- See Also:
- Constant Field Values
-
ovrHmdCap_DebugDevice
public static final int ovrHmdCap_DebugDevice
(read only) Specifies that the HMD is a virtual debug device.- See Also:
- Constant Field Values
-
ovrTrackingCap_Orientation
public static final int ovrTrackingCap_Orientation
Supports orientation tracking (IMU).- See Also:
- Constant Field Values
-
ovrTrackingCap_MagYawCorrection
public static final int ovrTrackingCap_MagYawCorrection
Supports yaw drift correction via a magnetometer or other means.- See Also:
- Constant Field Values
-
ovrTrackingCap_Position
public static final int ovrTrackingCap_Position
Supports positional tracking.- See Also:
- Constant Field Values
-
ovrEye_Left
public static final int ovrEye_Left
The left eye, from the viewer's perspective.- See Also:
- Constant Field Values
-
ovrEye_Right
public static final int ovrEye_Right
The right eye, from the viewer's perspective.- See Also:
- Constant Field Values
-
ovrTrackingOrigin_EyeLevel
public static final int ovrTrackingOrigin_EyeLevel
Tracking system origin reported at eye (HMD) height.Prefer using this origin when your application requires matching user's current physical head pose to a virtual head pose without any regards to a the height of the floor. Cockpit-based, or 3rd-person experiences are ideal candidates. When used, all poses in
OVRTrackingStateare reported as an offset transform from the profile calibrated or recentered HMD pose. It is recommended that apps using this origin type callRecenterTrackingOriginprior to starting the VR experience, but notify the user before doing so to make sure the user is in a comfortable pose, facing a comfortable direction.- See Also:
- Constant Field Values
-
ovrTrackingOrigin_FloorLevel
public static final int ovrTrackingOrigin_FloorLevel
Tracking system origin reported at floor height.Prefer using this origin when your application requires the physical floor height to match the virtual floor height, such as standing experiences. When used, all poses in
OVRTrackingStateare reported as an offset transform from the profile calibrated floor pose. CallingRecenterTrackingOriginwill recenter the X & Z axes as well as yaw, but the Y-axis (i.e. height) will continue to be reported using the floor height as the origin for all poses.- See Also:
- Constant Field Values
-
ovrStatus_OrientationTracked
public static final int ovrStatus_OrientationTracked
Orientation is currently tracked (connected and in use).- See Also:
- Constant Field Values
-
ovrStatus_PositionTracked
public static final int ovrStatus_PositionTracked
Position is currently tracked (false if out of range).- See Also:
- Constant Field Values
-
ovrTracker_Connected
public static final int ovrTracker_Connected
The sensor is present, else the sensor is absent or offline.- See Also:
- Constant Field Values
-
ovrTracker_PoseTracked
public static final int ovrTracker_PoseTracked
The sensor has a valid pose, else the pose is unavailable. This will only be set if ovrTracker_Connected is set.- See Also:
- Constant Field Values
-
ovrTexture_2D
public static final int ovrTexture_2D
2D textures- See Also:
- Constant Field Values
-
ovrTexture_2D_External
public static final int ovrTexture_2D_External
External 2D texture. Not used on PC- See Also:
- Constant Field Values
-
ovrTexture_Cube
public static final int ovrTexture_Cube
Cube maps. Not currently supported on PC.- See Also:
- Constant Field Values
-
ovrTextureBind_None
public static final int ovrTextureBind_None
The bindings required for texture swap chain. (ovrTextureBindFlags)All texture swap chains are automatically bindable as shader input resources since the Oculus runtime needs this to read them.
- See Also:
- Constant Field Values
-
ovrTextureBind_DX_RenderTarget
public static final int ovrTextureBind_DX_RenderTarget
The application can write into the chain with pixel shader- See Also:
- Constant Field Values
-
ovrTextureBind_DX_UnorderedAccess
public static final int ovrTextureBind_DX_UnorderedAccess
The application can write to the chain with compute shader- See Also:
- Constant Field Values
-
ovrTextureBind_DX_DepthStencil
public static final int ovrTextureBind_DX_DepthStencil
The chain buffers can be bound as depth and/or stencil buffers- See Also:
- Constant Field Values
-
OVR_FORMAT_UNKNOWN
public static final int OVR_FORMAT_UNKNOWN
The format of a texture. (ovrTextureFormat)- See Also:
- Constant Field Values
-
OVR_FORMAT_R8G8B8A8_UNORM
public static final int OVR_FORMAT_R8G8B8A8_UNORM
The format of a texture. (ovrTextureFormat)- See Also:
- Constant Field Values
-
OVR_FORMAT_R8G8B8A8_UNORM_SRGB
public static final int OVR_FORMAT_R8G8B8A8_UNORM_SRGB
The format of a texture. (ovrTextureFormat)- See Also:
- Constant Field Values
-
OVR_FORMAT_B8G8R8A8_UNORM
public static final int OVR_FORMAT_B8G8R8A8_UNORM
The format of a texture. (ovrTextureFormat)- See Also:
- Constant Field Values
-
OVR_FORMAT_R16G16B16A16_FLOAT
public static final int OVR_FORMAT_R16G16B16A16_FLOAT
The format of a texture. (ovrTextureFormat)- See Also:
- Constant Field Values
-
OVR_FORMAT_D16_UNORM
public static final int OVR_FORMAT_D16_UNORM
The format of a texture. (ovrTextureFormat)- See Also:
- Constant Field Values
-
OVR_FORMAT_D24_UNORM_S8_UINT
public static final int OVR_FORMAT_D24_UNORM_S8_UINT
The format of a texture. (ovrTextureFormat)- See Also:
- Constant Field Values
-
OVR_FORMAT_D32_FLOAT
public static final int OVR_FORMAT_D32_FLOAT
The format of a texture. (ovrTextureFormat)- See Also:
- Constant Field Values
-
OVR_FORMAT_D32_FLOAT_S8X24_UINT
public static final int OVR_FORMAT_D32_FLOAT_S8X24_UINT
The format of a texture. (ovrTextureFormat)- See Also:
- Constant Field Values
-
OVR_FORMAT_B5G6R5_UNORM
public static final int OVR_FORMAT_B5G6R5_UNORM
Not currently supported on PC. Would require a DirectX 11.1 device.- See Also:
- Constant Field Values
-
OVR_FORMAT_B5G5R5A1_UNORM
public static final int OVR_FORMAT_B5G5R5A1_UNORM
Not currently supported on PC. Would require a DirectX 11.1 device.- See Also:
- Constant Field Values
-
OVR_FORMAT_B4G4R4A4_UNORM
public static final int OVR_FORMAT_B4G4R4A4_UNORM
Not currently supported on PC. Would require a DirectX 11.1 device.- See Also:
- Constant Field Values
-
OVR_FORMAT_B8G8R8A8_UNORM_SRGB
public static final int OVR_FORMAT_B8G8R8A8_UNORM_SRGB
Not supported for OpenGL applications.- See Also:
- Constant Field Values
-
OVR_FORMAT_B8G8R8X8_UNORM
public static final int OVR_FORMAT_B8G8R8X8_UNORM
Not supported for OpenGL applications.- See Also:
- Constant Field Values
-
OVR_FORMAT_B8G8R8X8_UNORM_SRGB
public static final int OVR_FORMAT_B8G8R8X8_UNORM_SRGB
Not supported for OpenGL applications.- See Also:
- Constant Field Values
-
ovrTextureMisc_None
public static final int ovrTextureMisc_None
Misc flags overriding particular behaviors of a texture swap chain. (ovrTextureFlags)- See Also:
- Constant Field Values
-
ovrTextureMisc_DX_Typeless
public static final int ovrTextureMisc_DX_Typeless
DX only: The underlying texture is created with a TYPELESS equivalent of the format specified in the texture desc. The SDK will still access the texture using the format specified in the texture desc, but the app can create views with different formats if this is specified.- See Also:
- Constant Field Values
-
ovrTextureMisc_AllowGenerateMips
public static final int ovrTextureMisc_AllowGenerateMips
DX only: Allow generation of the mip chain on the GPU via the GenerateMips call. This flag requires that RenderTarget binding also be specified.- See Also:
- Constant Field Values
-
ovrTextureMisc_ProtectedContent
public static final int ovrTextureMisc_ProtectedContent
Texture swap chain contains protected content, and requires HDCP connection in order to display to HMD. Also prevents mirroring or other redirection of any frame containing this contents- See Also:
- Constant Field Values
-
ovrButton_A
public static final int ovrButton_A
Button A- See Also:
- Constant Field Values
-
ovrButton_B
public static final int ovrButton_B
Button B- See Also:
- Constant Field Values
-
ovrButton_RThumb
public static final int ovrButton_RThumb
Button RThumb- See Also:
- Constant Field Values
-
ovrButton_RShoulder
public static final int ovrButton_RShoulder
Button RShoulder- See Also:
- Constant Field Values
-
ovrButton_RMask
public static final int ovrButton_RMask
Bit mask of all buttons on the right Touch controller- See Also:
- Constant Field Values
-
ovrButton_X
public static final int ovrButton_X
Button X- See Also:
- Constant Field Values
-
ovrButton_Y
public static final int ovrButton_Y
Button Y- See Also:
- Constant Field Values
-
ovrButton_LThumb
public static final int ovrButton_LThumb
Button LThumb- See Also:
- Constant Field Values
-
ovrButton_LShoulder
public static final int ovrButton_LShoulder
Button LShoulder- See Also:
- Constant Field Values
-
ovrButton_LMask
public static final int ovrButton_LMask
Bit mask of all buttons on the left Touch controller- See Also:
- Constant Field Values
-
ovrButton_Up
public static final int ovrButton_Up
Button Up- See Also:
- Constant Field Values
-
ovrButton_Down
public static final int ovrButton_Down
Button Down- See Also:
- Constant Field Values
-
ovrButton_Left
public static final int ovrButton_Left
Button Left- See Also:
- Constant Field Values
-
ovrButton_Right
public static final int ovrButton_Right
Button Right- See Also:
- Constant Field Values
-
ovrButton_Enter
public static final int ovrButton_Enter
Button Enter- See Also:
- Constant Field Values
-
ovrButton_Back
public static final int ovrButton_Back
Button Back- See Also:
- Constant Field Values
-
ovrButton_VolUp
public static final int ovrButton_VolUp
Button VolUp- See Also:
- Constant Field Values
-
ovrButton_VolDown
public static final int ovrButton_VolDown
Button VolDown- See Also:
- Constant Field Values
-
ovrButton_Home
public static final int ovrButton_Home
Button Home- See Also:
- Constant Field Values
-
ovrButton_Private
public static final int ovrButton_Private
Button input types. (ovrTouch)- See Also:
- Constant Field Values
-
ovrTouch_A
public static final int ovrTouch_A
Touch A- See Also:
- Constant Field Values
-
ovrTouch_B
public static final int ovrTouch_B
Touch B- See Also:
- Constant Field Values
-
ovrTouch_RThumb
public static final int ovrTouch_RThumb
Touch RThumb- See Also:
- Constant Field Values
-
ovrTouch_RIndexTrigger
public static final int ovrTouch_RIndexTrigger
Touch RIndexTrigger- See Also:
- Constant Field Values
-
ovrTouch_RButtonMask
public static final int ovrTouch_RButtonMask
Bit mask of all the button touches on the right controller- See Also:
- Constant Field Values
-
ovrTouch_X
public static final int ovrTouch_X
Touch X- See Also:
- Constant Field Values
-
ovrTouch_Y
public static final int ovrTouch_Y
Touch Y- See Also:
- Constant Field Values
-
ovrTouch_LThumb
public static final int ovrTouch_LThumb
Touch LThumb- See Also:
- Constant Field Values
-
ovrTouch_LIndexTrigger
public static final int ovrTouch_LIndexTrigger
Touch LIndexTrigger- See Also:
- Constant Field Values
-
ovrTouch_LButtonMask
public static final int ovrTouch_LButtonMask
Bit mask of all the button touches on the left controller- See Also:
- Constant Field Values
-
ovrTouch_RIndexPointing
public static final int ovrTouch_RIndexPointing
TouchRIndexPointing- See Also:
- Constant Field Values
-
ovrTouch_RThumbUp
public static final int ovrTouch_RThumbUp
Touch RThumbUp- See Also:
- Constant Field Values
-
ovrTouch_RPoseMask
public static final int ovrTouch_RPoseMask
Bit mask of all right controller poses- See Also:
- Constant Field Values
-
ovrTouch_LIndexPointing
public static final int ovrTouch_LIndexPointing
Touch LIndexPointing- See Also:
- Constant Field Values
-
ovrTouch_LThumbUp
public static final int ovrTouch_LThumbUp
Touch LThumbUp- See Also:
- Constant Field Values
-
ovrTouch_LPoseMask
public static final int ovrTouch_LPoseMask
Bit mask of all left controller poses.- See Also:
- Constant Field Values
-
ovrControllerType_None
public static final int ovrControllerType_None
Which controller is connected; multiple can be connected at once. (ovrControllerType)- See Also:
- Constant Field Values
-
ovrControllerType_LTouch
public static final int ovrControllerType_LTouch
Which controller is connected; multiple can be connected at once. (ovrControllerType)- See Also:
- Constant Field Values
-
ovrControllerType_RTouch
public static final int ovrControllerType_RTouch
Which controller is connected; multiple can be connected at once. (ovrControllerType)- See Also:
- Constant Field Values
-
ovrControllerType_Touch
public static final int ovrControllerType_Touch
Which controller is connected; multiple can be connected at once. (ovrControllerType)- See Also:
- Constant Field Values
-
ovrControllerType_Remote
public static final int ovrControllerType_Remote
Which controller is connected; multiple can be connected at once. (ovrControllerType)- See Also:
- Constant Field Values
-
ovrControllerType_XBox
public static final int ovrControllerType_XBox
Which controller is connected; multiple can be connected at once. (ovrControllerType)- See Also:
- Constant Field Values
-
ovrControllerType_Active
public static final int ovrControllerType_Active
Operate on or query whichever controller is active.- See Also:
- Constant Field Values
-
ovrHand_Left
public static final int ovrHand_Left
Names for the left and right hand array indexes. (ovrHandType)- See Also:
- Constant Field Values
-
ovrHand_Right
public static final int ovrHand_Right
Names for the left and right hand array indexes. (ovrHandType)- See Also:
- Constant Field Values
-
ovrMaxLayerCount
public static final int ovrMaxLayerCount
Specifies the maximum number of layers supported bySubmitFrame.- See Also:
- Constant Field Values
-
ovrLayerType_Disabled
public static final int ovrLayerType_Disabled
Layer is disabled.- See Also:
- Constant Field Values
-
ovrLayerType_EyeFov
public static final int ovrLayerType_EyeFov
Described byOVRLayerEyeFov.- See Also:
- Constant Field Values
-
ovrLayerType_Quad
public static final int ovrLayerType_Quad
Described byOVRLayerQuad.- See Also:
- Constant Field Values
-
ovrLayerType_EyeMatrix
public static final int ovrLayerType_EyeMatrix
Described byOVRLayerEyeMatrix.- See Also:
- Constant Field Values
-
ovrLayerFlag_HighQuality
public static final int ovrLayerFlag_HighQuality
Enables 4x anisotropic sampling during the composition of the layer. The benefits are mostly visible at the periphery for high-frequency & high-contrast visuals. For best results consider combining this flag with anovrTextureSwapChainthat has mipmaps and instead of using arbitrary sized textures, prefer texture sizes that are powers-of-two. Actual rendered viewport and doesn't necessarily have to fill the whole texture.- See Also:
- Constant Field Values
-
ovrLayerFlag_TextureOriginAtBottomLeft
public static final int ovrLayerFlag_TextureOriginAtBottomLeft
the opposite is TopLeft. Generally this is false for D3D, true for OpenGL.- See Also:
- Constant Field Values
-
ovrLayerFlag_HeadLocked
public static final int ovrLayerFlag_HeadLocked
Mark this surface as "headlocked", which means it is specified relative to the HMD and moves with it, rather than being specified relative to sensor/torso space and remaining still while the head moves. What used to beovrLayerType_QuadHeadLockedis nowLayerType_Quadplus this flag. However the flag can be applied to any layer type to achieve a similar effect.- See Also:
- Constant Field Values
-
ovrPerfHud_Off
public static final int ovrPerfHud_Off
Turns off the performance HUD- See Also:
- Constant Field Values
-
ovrPerfHud_PerfSummary
public static final int ovrPerfHud_PerfSummary
Shows performance summary and headroom- See Also:
- Constant Field Values
-
ovrPerfHud_LatencyTiming
public static final int ovrPerfHud_LatencyTiming
Shows latency related timing info- See Also:
- Constant Field Values
-
ovrPerfHud_AppRenderTiming
public static final int ovrPerfHud_AppRenderTiming
Shows render timing info for application- See Also:
- Constant Field Values
-
ovrPerfHud_CompRenderTiming
public static final int ovrPerfHud_CompRenderTiming
Shows render timing info for OVR compositor- See Also:
- Constant Field Values
-
ovrPerfHud_VersionInfo
public static final int ovrPerfHud_VersionInfo
Shows SDK & HMD version Info- See Also:
- Constant Field Values
-
ovrLayerHud_Off
public static final int ovrLayerHud_Off
Turns off the layer HUD- See Also:
- Constant Field Values
-
ovrLayerHud_Info
public static final int ovrLayerHud_Info
Shows info about a specific layer- See Also:
- Constant Field Values
-
ovrDebugHudStereo_Off
public static final int ovrDebugHudStereo_Off
Visual properties of the stereo guide.- See Also:
- Constant Field Values
-
ovrDebugHudStereo_Quad
public static final int ovrDebugHudStereo_Quad
Visual properties of the stereo guide.- See Also:
- Constant Field Values
-
ovrDebugHudStereo_QuadWithCrosshair
public static final int ovrDebugHudStereo_QuadWithCrosshair
Visual properties of the stereo guide.- See Also:
- Constant Field Values
-
ovrDebugHudStereo_CrosshairAtInfinity
public static final int ovrDebugHudStereo_CrosshairAtInfinity
Visual properties of the stereo guide.- See Also:
- Constant Field Values
-
-
Method Detail
-
ovr_Initialize
public static int ovr_Initialize(OVRInitParams params)
Initialize LibOVR for application usage. This includes finding and loading the LibOVRRT shared library. No LibOVR API functions, other thanGetLastErrorInfoand_Detect, can be called unlessInitializesucceeds. A successful call toovr_Initializemust be eventually followed by a call toShutdown.ovr_Initializecalls are idempotent. Callingovr_Initializetwice does not require two matching calls toovr_Shutdown. If already initialized, the return value isSuccess.LibOVRRT shared library search order:
- Current working directory (often the same as the application directory).
- Module directory (usually the same as the application directory, but not if the module is a separate shared library).
- Application directory
- Development directory (only if OVR_ENABLE_DEVELOPER_SEARCH is enabled, which is off by default).
- Standard OS shared library search location(s) (OS-specific).
- Parameters:
params- anOVRInitParamsstruct that cpecifies custom initialization options. May beNULLto indicate default options.- Returns:
- an
ovrResultindicating success or failure. In the case of failure, useGetLastErrorInfoto get more information. Example failed results include:Error_Initialize: Generic initialization error.Error_LibLoad: Couldn't load LibOVRRT.Error_LibVersion: LibOVRRT version incompatibility.Error_ServiceConnection: Couldn't connect to the OVR Service.Error_ServiceVersion: OVR Service version incompatibility.Error_IncompatibleOS: The operating system version is incompatible.Error_DisplayInit: Unable to initialize the HMD display.Error_ServerStart: Unable to start the server. Is it already running?Error_Reinitialization: Attempted to re-initialize with a different version.
-
ovr_Shutdown
public static void ovr_Shutdown()
Shuts down LibOVR.A successful call to
Initializemust be eventually matched by a call toovr_Shutdown. After callingovr_Shutdown, no LibOVR functions can be called exceptGetLastErrorInfoor anotherInitialize.ovr_Shutdowninvalidates all pointers, references, and created objects previously returned by LibOVR functions. The LibOVRRT shared library can be unloaded byovr_Shutdown.
-
ovr_GetLastErrorInfo
public static void ovr_GetLastErrorInfo(OVRErrorInfo errorInfo)
Returns information about the most recent failed return value by the current thread for this library.This function itself can never generate an error. The last error is never cleared by LibOVR, but will be overwritten by new errors. Do not use this call to determine if there was an error in the last API call as successful API calls don't clear the last
OVRErrorInfo. To avoid any inconsistency,GetLastErrorInfoshould be called immediately after an API function that returned a failedovrResult, with no other API functions called in the interim.- Parameters:
errorInfo- The lastOVRErrorInfofor the current thread
-
ovr_GetVersionString
public static java.lang.String ovr_GetVersionString()
Returns the version string representing the LibOVRRT version.The returned string pointer is valid until the next call to
Shutdown.Note that the returned version string doesn't necessarily match the current OVR_MAJOR_VERSION, etc., as the returned string refers to the LibOVRRT shared library version and not the locally compiled interface version.
The format of this string is subject to change in future versions and its contents should not be interpreted.
- Returns:
- a UTF8-encoded null-terminated version string
-
ovr_TraceMessage
public static java.lang.String ovr_TraceMessage(int level, java.nio.ByteBuffer message)Writes a message string to the LibOVR tracing mechanism (if enabled).This message will be passed back to the application via the
OVRLogCallbackif it was registered.- Parameters:
level- anovrLogLevelconstant. One of:LogLevel_DebugLogLevel_InfoLogLevel_Errormessage- a UTF8-encoded null-terminated string- Returns:
- the
strlenof the message or a negative value if the message is too large
-
ovr_TraceMessage
public static java.lang.String ovr_TraceMessage(int level, java.lang.CharSequence message)Writes a message string to the LibOVR tracing mechanism (if enabled).This message will be passed back to the application via the
OVRLogCallbackif it was registered.- Parameters:
level- anovrLogLevelconstant. One of:LogLevel_DebugLogLevel_InfoLogLevel_Errormessage- a UTF8-encoded null-terminated string- Returns:
- the
strlenof the message or a negative value if the message is too large
-
ovr_GetHmdDesc
public static OVRHmdDesc ovr_GetHmdDesc(long session, OVRHmdDesc __result)
Returns information about the current HMD.Initializemust have first been called in order for this to succeed, otherwise ovrHmdDesc::Type will be reported asHmd_None.- Parameters:
session- anovrSessionpreviously returned byCreate, elseNULLin which case this function detects whether an HMD is present and returns its info if so.__result- anOVRHmdDesc. If thehmdisNULLand ovrHmdDesc::Type isHmd_Nonethen no HMD is present.
-
ovr_GetTrackerCount
public static int ovr_GetTrackerCount(long session)
Returns the number of sensors.The number of sensors may change at any time, so this function should be called before use as opposed to once on startup.
- Parameters:
session- anovrSessionpreviously returned byCreate
-
ovr_GetTrackerDesc
public static OVRTrackerDesc ovr_GetTrackerDesc(long session, int trackerDescIndex, OVRTrackerDesc __result)
Returns a given sensor description.It's possible that sensor
desc [0]may indicate a unconnnected or non-pose tracked sensor, but sensordesc [1]may be connected.Initializemust have first been called in order for this to succeed, otherwise the returnedtrackerDescArraywill be zero-initialized. The data returned by this function can change at runtime.- Parameters:
session- anovrSessionpreviously returned byCreatetrackerDescIndex- a sensor index. The valid indexes are in the range of 0 to the sensor count returned byGetTrackerCount.__result- anOVRTrackerDesc. An emptyOVRTrackerDescwill be returned iftrackerDescIndexis out of range.
-
ovr_Create
public static int ovr_Create(PointerBuffer pSession, OVRGraphicsLuid luid)
Creates a handle to a VR session.Upon success the returned
ovrSessionmust be eventually freed withDestroywhen it is no longer needed. A second call toCreatewill result in an error return value if the previousHmdhas not been destroyed.- Parameters:
pSession- a pointer to anovrSessionwhich will be written to upon successluid- a system specific graphics adapter identifier that locates which graphics adapter has the HMD attached. This must match the adapter used by the application or no rendering output will be possible. This is important for stability on multi-adapter systems. An application that simply chooses the default adapter will not run reliably on multi-adapter systems.- Returns:
- an
ovrResultindicating success or failure. Upon failure the returnedpHmdwill beNULL.
-
ovr_Destroy
public static void ovr_Destroy(long session)
Destroys the HMD.- Parameters:
session- anovrSessionpreviously returned byCreate
-
ovr_GetSessionStatus
public static int ovr_GetSessionStatus(long session, OVRSessionStatus sessionStatus)Returns status information for the application.- Parameters:
session- anovrSessionpreviously returned byCreatesessionStatus- anOVRSessionStatusthat is filled in
-
ovr_SetTrackingOriginType
public static int ovr_SetTrackingOriginType(long session, int origin)Sets the tracking origin type.When the tracking origin is changed, all of the calls that either provide or accept ovrPosef will use the new tracking origin provided.
-
ovr_GetTrackingOriginType
public static int ovr_GetTrackingOriginType(long session)
Gets the tracking origin state.- Parameters:
session- anovrSessionpreviously returned byCreate
-
ovr_RecenterTrackingOrigin
public static int ovr_RecenterTrackingOrigin(long session)
Re-centers the sensor position and orientation.This resets the (x,y,z) positional components and the yaw orientation component. The Roll and pitch orientation components are always determined by gravity and cannot be redefined. All future tracking will report values relative to this new reference position. If you are using
OVRTrackerPosethen you will need to callGetTrackerPoseafter this, because the sensor position(s) will change as a result of this.The headset cannot be facing vertically upward or downward but rather must be roughly level otherwise this function will fail with
Error_InvalidHeadsetOrientation.For more info, see the notes on each
ovrTrackingOriginenumeration to understand how recenter will vary slightly in its behavior based on the currentovrTrackingOriginsetting.- Parameters:
session- anovrSessionpreviously returned byCreate
-
ovr_ClearShouldRecenterFlag
public static void ovr_ClearShouldRecenterFlag(long session)
Clears the ShouldRecenter status bit in ovrSessionStatus.Clears the
ShouldRecenterstatus bit inOVRSessionStatus, allowing further recenter requests to be detected. Since this is automatically done byRecenterTrackingOrigin, this is only needs to be called when application is doing its own re-centering.- Parameters:
session- anovrSessionpreviously returned byCreate
-
ovr_GetTrackingState
public static OVRTrackingState ovr_GetTrackingState(long session, double absTime, boolean latencyMarker, OVRTrackingState __result)
Returns tracking state reading based on the specified absolute system time.Pass an
absTimevalue of 0.0 to request the most recent sensor reading. In this case bothPredictedPoseandSamplePosewill have the same value.This may also be used for more refined timing of front buffer rendering logic, and so on.
This may be called by multiple threads.
- Parameters:
session- anovrSessionpreviously returned byCreateabsTime- the absolute future time to predict the returnOVRTrackingStatevalue. Use 0 to request the most recent tracking state.latencyMarker- specifies that this call is the point in time where the "App-to-Mid-Photon" latency timer starts from. If a givenovrLayerprovides "SensorSampleTimestamp", that will override the value stored here.__result- theOVRTrackingStatethat is predicted for the givenabsTime
-
ovr_GetTrackerPose
public static OVRTrackerPose ovr_GetTrackerPose(long session, int trackerPoseIndex, OVRTrackerPose __result)
Returns theOVRTrackerPosefor the given sensor.- Parameters:
session- anovrSessionpreviously returned byCreatetrackerPoseIndex- index of the sensor being requested.
-
ovr_GetInputState
public static int ovr_GetInputState(long session, int controllerType, OVRInputState inputState)Returns the most recent input state for controllers, without positional tracking info. Developers can tell whether the same state was returned by checking thePacketNumber.
-
ovr_GetConnectedControllerTypes
public static int ovr_GetConnectedControllerTypes(long session)
Returns controller types connected to the system OR'ed together.- Parameters:
session- anovrSessionpreviously returned byCreate
-
ovr_SetControllerVibration
public static int ovr_SetControllerVibration(long session, int controllerType, float frequency, float amplitude)Turns on vibration of the given controller.To disable vibration, call
SetControllerVibrationwith an amplitude of 0. Vibration automatically stops after a nominal amount of time, so if you want vibration to be continuous over multiple seconds then you need to call this function periodically.- Parameters:
session- anovrSessionpreviously returned byCreatecontrollerType- the controller to apply the vibration tofrequency- a vibration frequency in the range of 0.0 to 1.0. Currently the only valid values are 0.0, 0.5, and 1.0 and other values will be clamped to one of these.amplitude- a vibration amplitude in the range of 0.0 to 1.0.- Returns:
Successupon success
-
ovr_GetTextureSwapChainLength
public static int ovr_GetTextureSwapChainLength(long session, long chain, java.nio.IntBuffer out_Length)Gets the number of buffers in anovrTextureSwapChain.- Parameters:
session- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainfor which the length should be retrievedout_Length- returns the number of buffers in the specified chain
-
ovr_GetTextureSwapChainCurrentIndex
public static int ovr_GetTextureSwapChainCurrentIndex(long session, long chain, java.nio.IntBuffer out_Index)Gets the current index in anovrTextureSwapChain.- Parameters:
session- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainfor which the index should be retrievedout_Index- returns the current (free) index in specified chain
-
ovr_GetTextureSwapChainDesc
public static int ovr_GetTextureSwapChainDesc(long session, long chain, OVRTextureSwapChainDesc out_Desc)Gets the description of the buffers in anovrTextureSwapChain.- Parameters:
session- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainfor which the description should be retrievedout_Desc- returns the description of the specified chain
-
ovr_CommitTextureSwapChain
public static int ovr_CommitTextureSwapChain(long session, long chain)Commits any pending changes to anovrTextureSwapChain, and advances its current index.When Commit is called, the texture at the current index is considered ready for use by the runtime, and further writes to it should be avoided. The swap chain's current index is advanced, providing there's room in the chain. The next time the SDK dereferences this texture swap chain, it will synchronize with the app's graphics context and pick up the submitted index, opening up room in the swap chain for further commits.
- Parameters:
session- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainto commit
-
ovr_DestroyTextureSwapChain
public static void ovr_DestroyTextureSwapChain(long session, long chain)Destroys anovrTextureSwapChainand frees all the resources associated with it.- Parameters:
session- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainto destroy. If it isNULLthen this function has no effect.
-
ovr_DestroyMirrorTexture
public static void ovr_DestroyMirrorTexture(long session, long mirrorTexture)Destroys a mirror texture previously created by one of the mirror texture creation functions.- Parameters:
session- anovrSessionpreviously returned byCreatemirrorTexture- theovrTextureto destroy. If it isNULLthen this function has no effect.
-
ovr_GetFovTextureSize
public static OVRSizei ovr_GetFovTextureSize(long session, int eye, OVRFovPort fov, float pixelsPerDisplayPixel, OVRSizei __result)
Calculates the recommended viewport size for rendering a given eye within the HMD with a given FOV cone.Higher FOV will generally require larger textures to maintain quality. Apps packing multiple eye views together on the same texture should ensure there are at least 8 pixels of padding between them to prevent texture filtering and chromatic aberration causing images to leak between the two eye views.
Example code:
ovrHmdDesc hmdDesc = ovr_GetHmdDesc(session); ovrSizei eyeSizeLeft = ovr_GetFovTextureSize(session, ovrEye_Left, hmdDesc.DefaultEyeFov[ovrEye_Left], 1.0f); ovrSizei eyeSizeRight = ovr_GetFovTextureSize(session, ovrEye_Right, hmdDesc.DefaultEyeFov[ovrEye_Right], 1.0f);- Parameters:
session- anovrSessionpreviously returned byCreateeye- which eye (left or right) to calculate for. One of:Eye_LeftEye_Rightfov- theOVRFovPortto usepixelsPerDisplayPixel- the ratio of the number of render target pixels to display pixels at the center of distortion. 1.0 is the default value. Lower values can improve performance, higher values give improved quality.__result- the texture width and height size
-
ovr_GetRenderDesc
public static OVREyeRenderDesc ovr_GetRenderDesc(long session, int eyeType, OVRFovPort fov, OVREyeRenderDesc __result)
Computes the distortion viewport, view adjust, and other rendering parameters for the specified eye.- Parameters:
session- anovrSessionpreviously returned byCreateeyeType- which eye (left or right) for which to perform calculations. One of:Eye_LeftEye_Rightfov- theOVRFovPortto use.__result- the computedOVREyeRenderDescfor the giveneyeTypeand field of view
-
ovr_SubmitFrame
public static int ovr_SubmitFrame(long session, long frameIndex, OVRViewScaleDesc viewScaleDesc, PointerBuffer layerPtrList)Submits layers for distortion and display.ovr_SubmitFrametriggers distortion and processing which might happen asynchronously. The function will return when there is room in the submission queue and surfaces are available. Distortion might or might not have completed.- Layers are drawn in the order they are specified in the array, regardless of the layer type.
- Layers are not remembered between successive calls to
ovr_SubmitFrame. A layer must be specified in every call toovr_SubmitFrameor it won't be displayed. - If a
layerPtrListentry that was specified in a previous call toovr_SubmitFrameis passed asNULLor is of typeLayerType_Disabled, that layer is no longer displayed. - A
layerPtrListentry can be of any layer type and multiple entries of the same layer type are allowed. NolayerPtrListentry may be duplicated (i.e. the same pointer as an earlier entry).
Example code
ovrLayerEyeFov layer0; ovrLayerQuad layer1; ... ovrLayerHeader* layers[2] = { &layer0.Header, &layer1.Header }; ovrResult result = ovr_SubmitFrame(hmd, frameIndex, nullptr, layers, 2);- Parameters:
session- anovrSessionpreviously returned byCreateframeIndex- the targeted application frame index, or 0 to refer to one frame after the last timeSubmitFramewas calledviewScaleDesc- provides additional information needed only iflayerPtrListcontains anLayerType_Quad. IfNULL, a default version is used based on the current configuration and a 1.0 world scale.layerPtrList- a list ofovrLayerpointers, which can includeNULLentries to indicate that any previously shown layer at that index is to not be displayed. Each layer header must be a part of a layer structure such asOVRLayerEyeFovorOVRLayerQuad, withHeader.Typeidentifying its type. ANULLlayerPtrListentry in the array indicates the absence of the given layer.- Returns:
- an
ovrResultfor whichOVR_SUCCESS(result)is false upon error and true upon one of the possible success values:Success: rendering completed successfully.Success_NotVisible: rendering completed successfully but was not displayed on the HMD, usually because another application currently has ownership of the HMD. Applications receiving this result should stop rendering new content, but continue to callovr_SubmitFrameperiodically until it returns a value other thanSuccess_NotVisible.Error_DisplayLost: The session has become invalid (such as due to a device removal) and the shared resources need to be released (DestroyTextureSwapChain), the session needs to destroyed (Destroy) and recreated (Create), and new resources need to be created (ovr_CreateTextureSwapChainXXX). The application's existing private graphics resources do not need to be recreated unless the newovr_Createcall returns a differentGraphicsLuid.Error_TextureSwapChainInvalid: TheovrTextureSwapChainis in an incomplete or inconsistent state. EnsureCommitTextureSwapChainwas called at least once first.
-
ovr_GetPredictedDisplayTime
public static double ovr_GetPredictedDisplayTime(long session, long frameIndex)Gets the time of the specified frame midpoint.Predicts the time at which the given frame will be displayed. The predicted time is the middle of the time period during which the corresponding eye images will be displayed.
The application should increment frameIndex for each successively targeted frame, and pass that index to any relevent OVR functions that need to apply to the frame identified by that index.
This function is thread-safe and allows for multiple application threads to target their processing to the same displayed frame.
In the event that prediction fails due to various reasons (e.g. the display being off or app has yet to present any frames), the return value will be current CPU time.
- Parameters:
session- anovrSessionpreviously returned byCreateframeIndex- the frame the caller wishes to target. A value of zero returns the next frame index.- Returns:
- the absolute frame midpoint time for the given
frameIndex
-
ovr_GetTimeInSeconds
public static double ovr_GetTimeInSeconds()
Returns global, absolute high-resolution time in seconds.The time frame of reference for this function is not specified and should not be depended upon.
- Returns:
- seconds as a floating point value
-
ovr_GetBool
public static boolean ovr_GetBool(long session, java.nio.ByteBuffer propertyName, boolean defaultVal)Reads a boolean property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid for only the calldefaultVal- specifes the value to return if the property couldn't be read- Returns:
- the property interpreted as a boolean value. Returns
defaultValif the property doesn't exist.
-
ovr_GetBool
public static boolean ovr_GetBool(long session, java.lang.CharSequence propertyName, boolean defaultVal)Reads a boolean property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid for only the calldefaultVal- specifes the value to return if the property couldn't be read- Returns:
- the property interpreted as a boolean value. Returns
defaultValif the property doesn't exist.
-
ovr_SetBool
public static boolean ovr_SetBool(long session, java.nio.ByteBuffer propertyName, boolean value)Writes or creates a boolean property.If the property wasn't previously a boolean property, it is changed to a boolean property.
- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalue- the value to write- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_SetBool
public static boolean ovr_SetBool(long session, java.lang.CharSequence propertyName, boolean value)Writes or creates a boolean property.If the property wasn't previously a boolean property, it is changed to a boolean property.
- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalue- the value to write- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_GetInt
public static int ovr_GetInt(long session, java.nio.ByteBuffer propertyName, int defaultVal)Reads an integer property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the calldefaultVal- specifes the value to return if the property couldn't be read- Returns:
- the property interpreted as an integer value. Returns
defaultValif the property doesn't exist.
-
ovr_GetInt
public static int ovr_GetInt(long session, java.lang.CharSequence propertyName, int defaultVal)Reads an integer property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the calldefaultVal- specifes the value to return if the property couldn't be read- Returns:
- the property interpreted as an integer value. Returns
defaultValif the property doesn't exist.
-
ovr_SetInt
public static boolean ovr_SetInt(long session, java.nio.ByteBuffer propertyName, int value)Writes or creates an integer property.If the property wasn't previously an integer property, it is changed to an integer property.
- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalue- the value to write- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_SetInt
public static boolean ovr_SetInt(long session, java.lang.CharSequence propertyName, int value)Writes or creates an integer property.If the property wasn't previously an integer property, it is changed to an integer property.
- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalue- the value to write- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_GetFloat
public static float ovr_GetFloat(long session, java.nio.ByteBuffer propertyName, float defaultVal)Reads a float property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the calldefaultVal- specifes the value to return if the property couldn't be read- Returns:
- the property interpreted as a float value. Returns
defaultValif the property doesn't exist.
-
ovr_GetFloat
public static float ovr_GetFloat(long session, java.lang.CharSequence propertyName, float defaultVal)Reads a float property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the calldefaultVal- specifes the value to return if the property couldn't be read- Returns:
- the property interpreted as a float value. Returns
defaultValif the property doesn't exist.
-
ovr_SetFloat
public static boolean ovr_SetFloat(long session, java.nio.ByteBuffer propertyName, float value)Writes or creates a float property.If the property wasn't previously a float property, it's changed to a float property.
- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalue- the value to write- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_SetFloat
public static boolean ovr_SetFloat(long session, java.lang.CharSequence propertyName, float value)Writes or creates a float property.If the property wasn't previously a float property, it's changed to a float property.
- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalue- the value to write- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_GetFloatArray
public static int ovr_GetFloatArray(long session, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values)Reads a float array property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalues- an array of float to write to- Returns:
- the number of elements read, or 0 if property doesn't exist or is empty
-
ovr_GetFloatArray
public static int ovr_GetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)Reads a float array property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalues- an array of float to write to- Returns:
- the number of elements read, or 0 if property doesn't exist or is empty
-
ovr_SetFloatArray
public static boolean ovr_SetFloatArray(long session, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values)Writes or creates a float array property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalues- an array of float to write from- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_SetFloatArray
public static boolean ovr_SetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)Writes or creates a float array property.- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalues- an array of float to write from- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_GetString
public static java.lang.String ovr_GetString(long session, java.nio.ByteBuffer propertyName, java.nio.ByteBuffer defaultVal)Reads a string property.Strings are UTF8-encoded and null-terminated.
- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the calldefaultVal- specifes the value to return if the property couldn't be read- Returns:
- the string property if it exists. Otherwise returns
defaultVal, which can be specified asNULL. The return memory is guaranteed to be valid until next call toovr_GetStringor until the HMD is destroyed, whichever occurs first.
-
ovr_GetString
public static java.lang.String ovr_GetString(long session, java.lang.CharSequence propertyName, java.lang.CharSequence defaultVal)Reads a string property.Strings are UTF8-encoded and null-terminated.
- Parameters:
session- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the calldefaultVal- specifes the value to return if the property couldn't be read- Returns:
- the string property if it exists. Otherwise returns
defaultVal, which can be specified asNULL. The return memory is guaranteed to be valid until next call toovr_GetStringor until the HMD is destroyed, whichever occurs first.
-
ovr_SetString
public static boolean ovr_SetString(long hmddesc, java.nio.ByteBuffer propertyName, java.nio.ByteBuffer value)Writes or creates a string property.Strings are UTF8-encoded and null-terminated.
- Parameters:
hmddesc- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalue- the string property, which only needs to be valid for the duration of the call- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_SetString
public static boolean ovr_SetString(long hmddesc, java.lang.CharSequence propertyName, java.lang.CharSequence value)Writes or creates a string property.Strings are UTF8-encoded and null-terminated.
- Parameters:
hmddesc- anovrSessionpreviously returned byCreatepropertyName- the name of the property, which needs to be valid only for the callvalue- the string property, which only needs to be valid for the duration of the call- Returns:
- true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
-
ovr_GetTextureSwapChainLength
public static int ovr_GetTextureSwapChainLength(long session, long chain, int[] out_Length)Array version of:GetTextureSwapChainLength
-
ovr_GetTextureSwapChainCurrentIndex
public static int ovr_GetTextureSwapChainCurrentIndex(long session, long chain, int[] out_Index)Array version of:GetTextureSwapChainCurrentIndex
-
ovr_GetFloatArray
public static int ovr_GetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values)Array version of:GetFloatArray
-
ovr_GetFloatArray
public static int ovr_GetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)Array version of:GetFloatArray
-
ovr_SetFloatArray
public static boolean ovr_SetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values)Array version of:SetFloatArray
-
ovr_SetFloatArray
public static boolean ovr_SetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)Array version of:SetFloatArray
-
-