Oculus SDK  1.10
LibOVR Reference Manual
Data Structures | Macros | Typedefs | Enumerations | Functions
OVR_CAPI.h File Reference

C Interface to the Oculus PC SDK tracking and rendering library. More...

#include "OVR_CAPI_Keys.h"
#include "OVR_Version.h"
#include "OVR_ErrorCode.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  ovrColorf
 A RGBA color with normalized float components. More...
 
struct  ovrVector2i
 A 2D vector with integer components. More...
 
struct  ovrSizei
 A 2D size with integer components. More...
 
struct  ovrRecti
 A 2D rectangle with a position and size. More...
 
struct  ovrQuatf
 A quaternion rotation. More...
 
struct  ovrVector2f
 A 2D vector with float components. More...
 
struct  ovrVector3f
 A 3D vector with float components. More...
 
struct  ovrMatrix4f
 A 4x4 matrix with float elements. More...
 
struct  ovrPosef
 Position and orientation together. More...
 
struct  ovrPoseStatef
 A full pose (rigid body) configuration with first and second derivatives. More...
 
struct  ovrFovPort
 Describes the up, down, left, and right angles of the field of view. More...
 
struct  ovrGraphicsLuid
 Identifies a graphics device in a platform-specific way. More...
 
struct  ovrHmdDesc
 This is a complete descriptor of the HMD. More...
 
struct  ovrTrackerDesc
 Specifies the description of a single sensor. More...
 
struct  ovrTrackerPose
 Specifies the pose for a single sensor. More...
 
struct  ovrTrackingState
 Tracking state at a given absolute time (describes predicted HMD pose, etc.). More...
 
struct  ovrEyeRenderDesc
 Rendering information for each eye. More...
 
struct  ovrTimewarpProjectionDesc
 Projection information for ovrLayerEyeFovDepth. More...
 
struct  ovrViewScaleDesc
 Contains the data necessary to properly calculate position info for various layer types. More...
 
struct  ovrTextureSwapChainDesc
 Description used to create a texture swap chain. More...
 
struct  ovrMirrorTextureDesc
 Description used to create a mirror texture. More...
 
struct  ovrTouchHapticsDesc
 Describes the Touch Haptics engine. More...
 
struct  ovrHapticsBuffer
 Haptics buffer descriptor, contains amplitude samples used for Touch vibration. More...
 
struct  ovrHapticsPlaybackState
 State of the Haptics playback for Touch vibration. More...
 
struct  ovrBoundaryLookAndFeel
 Boundary system look and feel. More...
 
struct  ovrBoundaryTestResult
 Provides boundary test information. More...
 
struct  ovrInputState
 ovrInputState describes the complete controller input state, including Oculus Touch, and XBox gamepad. More...
 
struct  ovrInitParams
 Parameters for ovr_Initialize. More...
 
struct  ovrSessionStatus
 Specifies status information for the current session. More...
 
struct  ovrLayerHeader
 Defines properties shared by all ovrLayer structs, such as ovrLayerEyeFov. More...
 
struct  ovrLayerEyeFov
 Describes a layer that specifies a monoscopic or stereoscopic view. More...
 
struct  ovrLayerEyeMatrix
 Describes a layer that specifies a monoscopic or stereoscopic view. More...
 
struct  ovrLayerQuad
 Describes a layer of Quad type, which is a single quad in world or viewer space. More...
 
union  ovrLayer_Union
 Union that combines ovrLayer types in a way that allows them to be used in a polymorphic way. More...
 
struct  ovrPerfStatsPerCompositorFrame
 Contains the performance stats for a given SDK compositor frame. More...
 
struct  ovrPerfStats
 This is a complete descriptor of the performance stats provided by the SDK. More...
 

Macros

#define OVR_CAPI_h
 Header include guard.
 
#define OVR_OS_WIN32
 
#define OVR_CDECL   __cdecl
 LibOVR calling convention for 32-bit Windows builds.
 
#define OVR_EXTERN_C
 Defined as extern "C" when built from C++ code.
 
#define OVR_CC_HAS_FEATURE(x)   0
 Provided for backward compatibility with older versions of this library.
 
#define OVR_SA_UNUSED
 
#define OVR_SA_PASTE(a, b)   a##b
 
#define OVR_SA_HELP(a, b)   OVR_SA_PASTE(a,b)
 
#define OVR_STATIC_ASSERT(expression, msg)   typedef char OVR_SA_HELP(compileTimeAssert, __LINE__) [((expression) != 0) ? 1 : -1] OVR_SA_UNUSED
 
#define OVR_UNUSED_STRUCT_PAD(padName, size)   char padName[size];
 Defines explicitly unused space for a struct. More...
 
#define OVR_PTR_SIZE   4
 Specifies the size of a pointer on the given platform.
 
#define OVR_ON32(x)   x
 
#define OVR_ON64(x)
 
#define ovrFalse   0
 ovrBool value of false.
 
#define ovrTrue   1
 ovrBool value of true.
 

Typedefs

typedef char ovrBool
 Boolean type.
 
typedef struct ovrHmdStruct * ovrSession
 Used as an opaque pointer to an OVR session.
 
typedef struct ovrTextureSwapChainData * ovrTextureSwapChain
 
typedef struct ovrMirrorTextureData * ovrMirrorTexture
 
typedef void(OVR_CDECLovrLogCallback) (uintptr_t userData, int level, const char *message)
 Signature of the logging callback function pointer type. More...
 

Enumerations

enum  ovrHmdType {
  ovrHmd_None = 0, ovrHmd_DK1 = 3, ovrHmd_DKHD = 4, ovrHmd_DK2 = 6,
  ovrHmd_CB = 8, ovrHmd_Other = 9, ovrHmd_E3_2015 = 10, ovrHmd_ES06 = 11,
  ovrHmd_ES09 = 12, ovrHmd_ES11 = 13, ovrHmd_CV1 = 14, ovrHmd_EnumSize = 0x7fffffff
}
 Enumerates all HMD types that we support. More...
 
enum  ovrHmdCaps { ovrHmdCap_DebugDevice = 0x0010, ovrHmdCap_EnumSize = 0x7fffffff }
 HMD capability bits reported by device. More...
 
enum  ovrTrackingCaps { ovrTrackingCap_Orientation = 0x0010, ovrTrackingCap_MagYawCorrection = 0x0020, ovrTrackingCap_Position = 0x0040, ovrTrackingCap_EnumSize = 0x7fffffff }
 Tracking capability bits reported by the device. More...
 
enum  ovrEyeType { ovrEye_Left = 0, ovrEye_Right = 1, ovrEye_Count = 2, ovrEye_EnumSize = 0x7fffffff }
 Specifies which eye is being used for rendering. More...
 
enum  ovrTrackingOrigin { ovrTrackingOrigin_EyeLevel = 0, ovrTrackingOrigin_FloorLevel = 1, ovrTrackingOrigin_Count = 2, ovrTrackingOrigin_EnumSize = 0x7fffffff }
 Specifies the coordinate system ovrTrackingState returns tracking poses in. More...
 
enum  ovrStatusBits { ovrStatus_OrientationTracked = 0x0001, ovrStatus_PositionTracked = 0x0002, ovrStatus_EnumSize = 0x7fffffff }
 Bit flags describing the current status of sensor tracking. More...
 
enum  ovrTrackerFlags { ovrTracker_Connected = 0x0020, ovrTracker_PoseTracked = 0x0004 }
 Specifies sensor flags. More...
 
enum  ovrTextureType {
  ovrTexture_2D, ovrTexture_2D_External, ovrTexture_Cube, ovrTexture_Count,
  ovrTexture_EnumSize = 0x7fffffff
}
 The type of texture resource. More...
 
enum  ovrTextureBindFlags {
  ovrTextureBind_None, ovrTextureBind_DX_RenderTarget = 0x0001, ovrTextureBind_DX_UnorderedAccess = 0x0002, ovrTextureBind_DX_DepthStencil = 0x0004,
  ovrTextureBind_EnumSize = 0x7fffffff
}
 The bindings required for texture swap chain. More...
 
enum  ovrTextureFormat {
  OVR_FORMAT_UNKNOWN = 0, OVR_FORMAT_B5G6R5_UNORM = 1, OVR_FORMAT_B5G5R5A1_UNORM = 2, OVR_FORMAT_B4G4R4A4_UNORM = 3,
  OVR_FORMAT_R8G8B8A8_UNORM = 4, OVR_FORMAT_R8G8B8A8_UNORM_SRGB = 5, OVR_FORMAT_B8G8R8A8_UNORM = 6, OVR_FORMAT_B8G8R8A8_UNORM_SRGB = 7,
  OVR_FORMAT_B8G8R8X8_UNORM = 8, OVR_FORMAT_B8G8R8X8_UNORM_SRGB = 9, OVR_FORMAT_R16G16B16A16_FLOAT = 10, OVR_FORMAT_R11G11B10_FLOAT = 25,
  OVR_FORMAT_D16_UNORM = 11, OVR_FORMAT_D24_UNORM_S8_UINT = 12, OVR_FORMAT_D32_FLOAT = 13, OVR_FORMAT_D32_FLOAT_S8X24_UINT = 14,
  OVR_FORMAT_BC1_UNORM = 15, OVR_FORMAT_BC1_UNORM_SRGB = 16, OVR_FORMAT_BC2_UNORM = 17, OVR_FORMAT_BC2_UNORM_SRGB = 18,
  OVR_FORMAT_BC3_UNORM = 19, OVR_FORMAT_BC3_UNORM_SRGB = 20, OVR_FORMAT_BC6H_UF16 = 21, OVR_FORMAT_BC6H_SF16 = 22,
  OVR_FORMAT_BC7_UNORM = 23, OVR_FORMAT_BC7_UNORM_SRGB = 24, OVR_FORMAT_ENUMSIZE = 0x7fffffff
}
 The format of a texture. More...
 
enum  ovrTextureFlags {
  ovrTextureMisc_None, ovrTextureMisc_DX_Typeless = 0x0001, ovrTextureMisc_AllowGenerateMips = 0x0002, ovrTextureMisc_ProtectedContent = 0x0004,
  ovrTextureMisc_EnumSize = 0x7fffffff
}
 Misc flags overriding particular behaviors of a texture swap chain. More...
 
enum  ovrButton {
  ovrButton_A = 0x00000001, ovrButton_B = 0x00000002, ovrButton_RThumb = 0x00000004, ovrButton_RShoulder = 0x00000008,
  ovrButton_X = 0x00000100, ovrButton_Y = 0x00000200, ovrButton_LThumb = 0x00000400, ovrButton_LShoulder = 0x00000800,
  ovrButton_Up = 0x00010000, ovrButton_Down = 0x00020000, ovrButton_Left = 0x00040000, ovrButton_Right = 0x00080000,
  ovrButton_Enter = 0x00100000, ovrButton_Back = 0x00200000, ovrButton_VolUp = 0x00400000, ovrButton_VolDown = 0x00800000,
  ovrButton_Home = 0x01000000, ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home, ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder, ovrButton_LMask,
  ovrButton_EnumSize = 0x7fffffff
}
 Describes button input types. More...
 
enum  ovrTouch {
  ovrTouch_A = ovrButton_A, ovrTouch_B = ovrButton_B, ovrTouch_RThumb = ovrButton_RThumb, ovrTouch_RThumbRest = 0x00000008,
  ovrTouch_RIndexTrigger = 0x00000010, ovrTouch_RButtonMask = ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RThumbRest | ovrTouch_RIndexTrigger, ovrTouch_X = ovrButton_X, ovrTouch_Y = ovrButton_Y,
  ovrTouch_LThumb = ovrButton_LThumb, ovrTouch_LThumbRest = 0x00000800, ovrTouch_LIndexTrigger = 0x00001000, ovrTouch_LButtonMask = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger,
  ovrTouch_RIndexPointing = 0x00000020, ovrTouch_RThumbUp = 0x00000040, ovrTouch_LIndexPointing = 0x00002000, ovrTouch_LThumbUp = 0x00004000,
  ovrTouch_RPoseMask = ovrTouch_RIndexPointing | ovrTouch_RThumbUp, ovrTouch_LPoseMask = ovrTouch_LIndexPointing | ovrTouch_LThumbUp, ovrTouch_EnumSize = 0x7fffffff
}
 Describes touch input types. More...
 
enum  ovrControllerType {
  ovrControllerType_None = 0x00, ovrControllerType_LTouch = 0x01, ovrControllerType_RTouch = 0x02, ovrControllerType_Touch = 0x03,
  ovrControllerType_Remote = 0x04, ovrControllerType_XBox = 0x10, ovrControllerType_Active = 0xff, ovrControllerType_EnumSize = 0x7fffffff
}
 Specifies which controller is connected; multiple can be connected at once. More...
 
enum  ovrHapticsBufferSubmitMode { ovrHapticsBufferSubmit_Enqueue }
 Haptics buffer submit mode.
 
enum  ovrTrackedDeviceType {
  ovrTrackedDevice_HMD = 0x0001, ovrTrackedDevice_LTouch = 0x0002, ovrTrackedDevice_RTouch = 0x0004, ovrTrackedDevice_Touch = 0x0006,
  ovrTrackedDevice_All = 0xFFFF
}
 Position tracked devices.
 
enum  ovrBoundaryType { ovrBoundary_Outer = 0x0001, ovrBoundary_PlayArea = 0x0100 }
 Boundary types that specified while using the boundary system.
 
enum  ovrHandType { ovrHand_Left = 0, ovrHand_Right = 1, ovrHand_Count = 2, ovrHand_EnumSize = 0x7fffffff }
 Provides names for the left and right hand array indexes. More...
 
enum  ovrInitFlags { ovrInit_Debug = 0x00000001, ovrInit_RequestVersion = 0x00000004, ovrinit_WritableBits = 0x00ffffff, ovrInit_EnumSize = 0x7fffffff }
 Initialization flags. More...
 
enum  ovrLogLevel { ovrLogLevel_Debug = 0, ovrLogLevel_Info = 1, ovrLogLevel_Error = 2, ovrLogLevel_EnumSize = 0x7fffffff }
 Logging levels. More...
 
enum  ovrDebugHudStereoMode {
  ovrDebugHudStereo_Off = 0, ovrDebugHudStereo_Quad = 1, ovrDebugHudStereo_QuadWithCrosshair = 2, ovrDebugHudStereo_CrosshairAtInfinity = 3,
  ovrDebugHudStereo_Count, ovrDebugHudStereo_EnumSize = 0x7fffffff
}
 Debug HUD is provided to help developers gauge and debug the fidelity of their app's stereo rendering characteristics. More...
 
enum  { ovrMaxLayerCount = 16 }
 Specifies the maximum number of layers supported by ovr_SubmitFrame. More...
 
enum  ovrLayerType {
  ovrLayerType_Disabled = 0, ovrLayerType_EyeFov = 1, ovrLayerType_Quad = 3, ovrLayerType_EyeMatrix = 5,
  ovrLayerType_EnumSize = 0x7fffffff
}
 Describes layer types that can be passed to ovr_SubmitFrame. More...
 
enum  ovrLayerFlags { ovrLayerFlag_HighQuality = 0x01, ovrLayerFlag_TextureOriginAtBottomLeft = 0x02, ovrLayerFlag_HeadLocked = 0x04 }
 Identifies flags used by ovrLayerHeader and which are passed to ovr_SubmitFrame. More...
 

Functions

ovrResult ovr_Initialize (const ovrInitParams *params)
 Initializes LibOVR. More...
 
void ovr_Shutdown ()
 Shuts down LibOVR. More...
 
void ovr_GetLastErrorInfo (ovrErrorInfo *errorInfo)
 Returns information about the most recent failed return value by the current thread for this library. More...
 
const char * ovr_GetVersionString ()
 Returns the version string representing the LibOVRRT version. More...
 
int ovr_TraceMessage (int level, const char *message)
 Writes a message string to the LibOVR tracing mechanism (if enabled). More...
 
ovrResult ovr_IdentifyClient (const char *identity)
 Identify client application info. More...
 
HMD Management

Handles the enumeration, creation, destruction, and properties of an HMD (head-mounted display).

ovrHmdDesc ovr_GetHmdDesc (ovrSession session)
 Returns information about the current HMD. More...
 
unsigned int ovr_GetTrackerCount (ovrSession session)
 Returns the number of attached trackers. More...
 
ovrTrackerDesc ovr_GetTrackerDesc (ovrSession session, unsigned int trackerDescIndex)
 Returns a given attached tracker description. More...
 
ovrResult ovr_Create (ovrSession *pSession, ovrGraphicsLuid *pLuid)
 Creates a handle to a VR session. More...
 
void ovr_Destroy (ovrSession session)
 Destroys the session. More...
 
ovrResult ovr_GetSessionStatus (ovrSession session, ovrSessionStatus *sessionStatus)
 Returns status information for the application. More...
 
Tracking

Tracking functions handle the position, orientation, and movement of the HMD in space.

All tracking interface functions are thread-safe, allowing tracking state to be sampled from different threads.

ovrResult ovr_SetTrackingOriginType (ovrSession session, ovrTrackingOrigin origin)
 Sets the tracking origin type. More...
 
ovrTrackingOrigin ovr_GetTrackingOriginType (ovrSession session)
 Gets the tracking origin state. More...
 
ovrResult ovr_RecenterTrackingOrigin (ovrSession session)
 Re-centers the sensor position and orientation. More...
 
void ovr_ClearShouldRecenterFlag (ovrSession session)
 Clears the ShouldRecenter status bit in ovrSessionStatus. More...
 
ovrTrackingState ovr_GetTrackingState (ovrSession session, double absTime, ovrBool latencyMarker)
 Returns tracking state reading based on the specified absolute system time. More...
 
ovrTrackerPose ovr_GetTrackerPose (ovrSession session, unsigned int trackerPoseIndex)
 Returns the ovrTrackerPose for the given attached tracker. More...
 
ovrResult ovr_GetInputState (ovrSession session, ovrControllerType controllerType, ovrInputState *inputState)
 Returns the most recent input state for controllers, without positional tracking info. More...
 
unsigned int ovr_GetConnectedControllerTypes (ovrSession session)
 Returns controller types connected to the system OR'ed together. More...
 
ovrTouchHapticsDesc ovr_GetTouchHapticsDesc (ovrSession session, ovrControllerType controllerType)
 Gets information about Haptics engine for the specified Touch controller. More...
 
ovrResult ovr_SetControllerVibration (ovrSession session, ovrControllerType controllerType, float frequency, float amplitude)
 Sets constant vibration (with specified frequency and amplitude) to a controller. More...
 
ovrResult ovr_SubmitControllerVibration (ovrSession session, ovrControllerType controllerType, const ovrHapticsBuffer *buffer)
 Submits a Haptics buffer (used for vibration) to Touch (only) controllers. More...
 
ovrResult ovr_GetControllerVibrationState (ovrSession session, ovrControllerType controllerType, ovrHapticsPlaybackState *outState)
 Gets the Haptics engine playback state of a specific Touch controller. More...
 
ovrResult ovr_TestBoundary (ovrSession session, ovrTrackedDeviceType deviceBitmask, ovrBoundaryType boundaryType, ovrBoundaryTestResult *outTestResult)
 Tests collision/proximity of position tracked devices (e.g. More...
 
ovrResult ovr_TestBoundaryPoint (ovrSession session, const ovrVector3f *point, ovrBoundaryType singleBoundaryType, ovrBoundaryTestResult *outTestResult)
 Tests collision/proximity of a 3D point against the Boundary System. More...
 
ovrResult ovr_SetBoundaryLookAndFeel (ovrSession session, const ovrBoundaryLookAndFeel *lookAndFeel)
 Sets the look and feel of the Boundary System. More...
 
ovrResult ovr_ResetBoundaryLookAndFeel (ovrSession session)
 Resets the look and feel of the Boundary System to its default state. More...
 
ovrResult ovr_GetBoundaryGeometry (ovrSession session, ovrBoundaryType boundaryType, ovrVector3f *outFloorPoints, int *outFloorPointsCount)
 Gets the geometry of the Boundary System's "play area" or "outer boundary" as 3D floor points. More...
 
ovrResult ovr_GetBoundaryDimensions (ovrSession session, ovrBoundaryType boundaryType, ovrVector3f *outDimensions)
 Gets the dimension of the Boundary System's "play area" or "outer boundary". More...
 
ovrResult ovr_GetBoundaryVisible (ovrSession session, ovrBool *outIsVisible)
 Returns if the boundary is currently visible. More...
 
ovrResult ovr_RequestBoundaryVisible (ovrSession session, ovrBool visible)
 Requests boundary to be visible. More...
 
SDK Distortion Rendering

All of rendering functions including the configure and frame functions are not thread safe.

It is OK to use ConfigureRendering on one thread and handle frames on another thread, but explicit synchronization must be done since functions that depend on configured state are not reentrant.

These functions support rendering of distortion by the SDK.

ovrResult ovr_GetTextureSwapChainLength (ovrSession session, ovrTextureSwapChain chain, int *out_Length)
 TextureSwapChain creation is rendering API-specific. More...
 
ovrResult ovr_GetTextureSwapChainCurrentIndex (ovrSession session, ovrTextureSwapChain chain, int *out_Index)
 Gets the current index in an ovrTextureSwapChain. More...
 
ovrResult ovr_GetTextureSwapChainDesc (ovrSession session, ovrTextureSwapChain chain, ovrTextureSwapChainDesc *out_Desc)
 Gets the description of the buffers in an ovrTextureSwapChain. More...
 
ovrResult ovr_CommitTextureSwapChain (ovrSession session, ovrTextureSwapChain chain)
 Commits any pending changes to an ovrTextureSwapChain, and advances its current index. More...
 
void ovr_DestroyTextureSwapChain (ovrSession session, ovrTextureSwapChain chain)
 Destroys an ovrTextureSwapChain and frees all the resources associated with it. More...
 
void ovr_DestroyMirrorTexture (ovrSession session, ovrMirrorTexture mirrorTexture)
 MirrorTexture creation is rendering API-specific. More...
 
ovrSizei ovr_GetFovTextureSize (ovrSession session, ovrEyeType eye, ovrFovPort fov, float pixelsPerDisplayPixel)
 Calculates the recommended viewport size for rendering a given eye within the HMD with a given FOV cone. More...
 
ovrEyeRenderDesc ovr_GetRenderDesc (ovrSession session, ovrEyeType eyeType, ovrFovPort fov)
 Computes the distortion viewport, view adjust, and other rendering parameters for the specified eye. More...
 
ovrResult ovr_SubmitFrame (ovrSession session, long long frameIndex, const ovrViewScaleDesc *viewScaleDesc, ovrLayerHeader const *const *layerPtrList, unsigned int layerCount)
 Submits layers for distortion and display. More...
 
Property Access

These functions read and write OVR properties.

Supported properties are defined in OVR_CAPI_Keys.h

ovrBool ovr_GetBool (ovrSession session, const char *propertyName, ovrBool defaultVal)
 Reads a boolean property. More...
 
ovrBool ovr_SetBool (ovrSession session, const char *propertyName, ovrBool value)
 Writes or creates a boolean property. More...
 
int ovr_GetInt (ovrSession session, const char *propertyName, int defaultVal)
 Reads an integer property. More...
 
ovrBool ovr_SetInt (ovrSession session, const char *propertyName, int value)
 Writes or creates an integer property. More...
 
float ovr_GetFloat (ovrSession session, const char *propertyName, float defaultVal)
 Reads a float property. More...
 
ovrBool ovr_SetFloat (ovrSession session, const char *propertyName, float value)
 Writes or creates a float property. More...
 
unsigned int ovr_GetFloatArray (ovrSession session, const char *propertyName, float values[], unsigned int valuesCapacity)
 Reads a float array property. More...
 
ovrBool ovr_SetFloatArray (ovrSession session, const char *propertyName, const float values[], unsigned int valuesSize)
 Writes or creates a float array property. More...
 
const char * ovr_GetString (ovrSession session, const char *propertyName, const char *defaultVal)
 Reads a string property. More...
 
ovrBool ovr_SetString (ovrSession session, const char *propertyName, const char *value)
 Writes or creates a string property. More...
 

Frame Timing

enum  { ovrMaxProvidedFrameStats = 5 }
 Maximum number of frames of performance stats provided back to the caller of ovr_GetPerfStats.
 
enum  ovrPerfHudMode {
  ovrPerfHud_Off = 0, ovrPerfHud_PerfSummary = 1, ovrPerfHud_LatencyTiming = 2, ovrPerfHud_AppRenderTiming = 3,
  ovrPerfHud_CompRenderTiming = 4, ovrPerfHud_VersionInfo = 5, ovrPerfHud_Count = 6, ovrPerfHud_EnumSize = 0x7fffffff
}
 Performance HUD enables the HMD user to see information critical to the real-time operation of the VR application such as latency timing, and CPU & GPU performance metrics. More...
 
enum  ovrLayerHudMode { ovrLayerHud_Off = 0, ovrLayerHud_Info = 1, ovrLayerHud_EnumSize = 0x7fffffff }
 Layer HUD enables the HMD user to see information about a layer. More...
 
ovrResult ovr_GetPerfStats (ovrSession session, ovrPerfStats *outStats)
 Retrieves performance stats for the VR app as well as the SDK compositor. More...
 
ovrResult ovr_ResetPerfStats (ovrSession session)
 Resets the accumulated stats reported in each ovrPerfStatsPerCompositorFrame back to zero. More...
 
double ovr_GetPredictedDisplayTime (ovrSession session, long long frameIndex)
 Gets the time of the specified frame midpoint. More...
 
double ovr_GetTimeInSeconds ()
 Returns global, absolute high-resolution time in seconds. More...
 

Detailed Description

C Interface to the Oculus PC SDK tracking and rendering library.

Macro Definition Documentation

#define OVR_UNUSED_STRUCT_PAD (   padName,
  size 
)    char padName[size];

Defines explicitly unused space for a struct.

When used correcly, usage of this macro should not change the size of the struct. Compile-time and runtime behavior with and without this defined should be identical.

Typedef Documentation

typedef void(OVR_CDECL* ovrLogCallback) (uintptr_t userData, int level, const char *message)

Signature of the logging callback function pointer type.

Parameters
[in]userDatais an arbitrary value specified by the user of ovrInitParams.
[in]levelis one of the ovrLogLevel constants.
[in]messageis a UTF8-encoded null-terminated string.
See also
ovrInitParams, ovrLogLevel, ovr_Initialize

Enumeration Type Documentation

anonymous enum

Specifies the maximum number of layers supported by ovr_SubmitFrame.

/see ovr_SubmitFrame

enum ovrButton

Describes button input types.

Button inputs are combined; that is they will be reported as pressed if they are pressed on either one of the two devices. The ovrButton_Up/Down/Left/Right map to both XBox D-Pad and directional buttons. The ovrButton_Enter and ovrButton_Return map to Start and Back controller buttons, respectively.

Enumerator
ovrButton_B 

A button on XBox controllers and right Touch controller. Select button on Oculus Remote.

ovrButton_RThumb 

B button on XBox controllers and right Touch controller. Back button on Oculus Remote.

ovrButton_RShoulder 

Right thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.

ovrButton_X 

Right shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.

ovrButton_Y 

X button on XBox controllers and left Touch controller. Not present on Oculus Remote.

ovrButton_LThumb 

Y button on XBox controllers and left Touch controller. Not present on Oculus Remote.

ovrButton_LShoulder 

Left thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.

ovrButton_Up 

Left shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.

ovrButton_Down 

Up button on XBox controllers and Oculus Remote. Not present on Touch controllers.

ovrButton_Left 

Down button on XBox controllers and Oculus Remote. Not present on Touch controllers.

ovrButton_Right 

Left button on XBox controllers and Oculus Remote. Not present on Touch controllers.

ovrButton_Enter 

Right button on XBox controllers and Oculus Remote. Not present on Touch controllers.

ovrButton_Back 

Start on XBox 360 controller. Menu on XBox One controller and Left Touch controller. Should be referred to as the Menu button in user-facing documentation.

ovrButton_VolUp 

Back on Xbox 360 controller. View button on XBox One controller. Not present on Touch controllers or Oculus Remote.

ovrButton_VolDown 

Volume button on Oculus Remote. Not present on XBox or Touch controllers.

ovrButton_Home 

Volume button on Oculus Remote. Not present on XBox or Touch controllers.

ovrButton_Private 

Home button on XBox controllers. Oculus button on Touch controllers and Oculus Remote.

Specifies which controller is connected; multiple can be connected at once.

Enumerator
ovrControllerType_Active 

Operate on or query whichever controller is active.

Debug HUD is provided to help developers gauge and debug the fidelity of their app's stereo rendering characteristics.

Using the provided quad and crosshair guides, the developer can verify various aspects such as VR tracking units (e.g. meters), stereo camera-parallax properties (e.g. making sure objects at infinity are rendered with the proper separation), measuring VR geometry sizes and distances and more.

App can toggle the debug HUD modes as such:
ovr_SetInt(session, OVR_DEBUG_HUD_STEREO_MODE, (int)DebugHudMode);

The app can modify the visual properties of the stereo guide (i.e. quad, crosshair) using the ovr_SetFloatArray function. For a list of tweakable properties, see the OVR_DEBUG_HUD_STEREO_GUIDE_* keys in the OVR_CAPI_Keys.h header file.

Enumerator
ovrDebugHudStereo_Off 

Turns off the Stereo Debug HUD.

ovrDebugHudStereo_Quad 

Renders Quad in world for Stereo Debugging.

ovrDebugHudStereo_QuadWithCrosshair 

Renders Quad+crosshair in world for Stereo Debugging.

ovrDebugHudStereo_CrosshairAtInfinity 

Renders screen-space crosshair at infinity for Stereo Debugging.

enum ovrEyeType

Specifies which eye is being used for rendering.

This type explicitly does not include a third "NoStereo" monoscopic option, as such is not required for an HMD-centered API.

Enumerator
ovrEye_Left 

The left eye, from the viewer's perspective.

ovrEye_Right 

The right eye, from the viewer's perspective.

Provides names for the left and right hand array indexes.

See also
ovrInputState, ovrTrackingState
enum ovrHmdCaps

HMD capability bits reported by device.

Enumerator
ovrHmdCap_DebugDevice 

(read only) Specifies that the HMD is a virtual debug device.

enum ovrHmdType

Enumerates all HMD types that we support.

The currently released developer kits are ovrHmd_DK1 and ovrHmd_DK2. The other enumerations are for internal use only.

Initialization flags.

See also
ovrInitParams, ovr_Initialize
Enumerator
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.

ovrInit_RequestVersion 

When a version is requested, the LibOVR runtime respects the RequestedMinorVersion field and verifies that the RequestedMinorVersion is supported.

Normally when you specify this flag you simply use OVR_MINOR_VERSION for ovrInitParams::RequestedMinorVersion, though you could use a lower version than OVR_MINOR_VERSION to specify previous version behavior.

Identifies flags used by ovrLayerHeader and which are passed to ovr_SubmitFrame.

See also
ovrLayerHeader
Enumerator
ovrLayerFlag_HighQuality 

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 an ovrTextureSwapChain that 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.

ovrLayerFlag_TextureOriginAtBottomLeft 

ovrLayerFlag_TextureOriginAtBottomLeft: the opposite is TopLeft.

Generally this is false for D3D, true for OpenGL.

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 be ovrLayerType_QuadHeadLocked is now ovrLayerType_Quad plus this flag. However the flag can be applied to any layer type to achieve a similar effect.

Layer HUD enables the HMD user to see information about a layer.

App can toggle layer HUD modes as such:

ovr_SetInt(session, OVR_LAYER_HUD_MODE, (int)LayerHudMode);
Enumerator
ovrLayerHud_Off 

Turns off the layer HUD.

ovrLayerHud_Info 

Shows info about a specific layer.

Describes layer types that can be passed to ovr_SubmitFrame.

Each layer type has an associated struct, such as ovrLayerEyeFov.

See also
ovrLayerHeader
Enumerator
ovrLayerType_Disabled 

Layer is disabled.

ovrLayerType_EyeFov 

Described by ovrLayerEyeFov.

ovrLayerType_Quad 

Described by ovrLayerQuad.

Previously called ovrLayerType_QuadInWorld.

ovrLayerType_EyeMatrix 

enum 4 used to be ovrLayerType_QuadHeadLocked. Instead, use ovrLayerType_Quad with ovrLayerFlag_HeadLocked.

Described by ovrLayerEyeMatrix.

ovrLayerType_EnumSize 

Force type int32_t.

Logging levels.

See also
ovrInitParams, ovrLogCallback
Enumerator
ovrLogLevel_Debug 

Debug-level log event.

ovrLogLevel_Info 

Info-level log event.

ovrLogLevel_Error 

Error-level log event.

Performance HUD enables the HMD user to see information critical to the real-time operation of the VR application such as latency timing, and CPU & GPU performance metrics.

App can toggle performance HUD modes as such:

ovr_SetInt(session, OVR_PERF_HUD_MODE, (int)PerfHudMode);
Enumerator
ovrPerfHud_Off 

Turns off the performance HUD.

ovrPerfHud_PerfSummary 

Shows performance summary and headroom.

ovrPerfHud_LatencyTiming 

Shows latency related timing info.

ovrPerfHud_AppRenderTiming 

Shows render timing info for application.

ovrPerfHud_CompRenderTiming 

Shows render timing info for OVR compositor.

ovrPerfHud_VersionInfo 

Shows SDK & HMD version Info.

Bit flags describing the current status of sensor tracking.

The values must be the same as in enum StatusBits

See also
ovrTrackingState
Enumerator
ovrStatus_OrientationTracked 

Orientation is currently tracked (connected and in use).

ovrStatus_PositionTracked 

Position is currently tracked (false if out of range).

The bindings required for texture swap chain.

All texture swap chains are automatically bindable as shader input resources since the Oculus runtime needs this to read them.

See also
ovrTextureSwapChainDesc
Enumerator
ovrTextureBind_DX_RenderTarget 

The application can write into the chain with pixel shader.

ovrTextureBind_DX_UnorderedAccess 

The application can write to the chain with compute shader.

ovrTextureBind_DX_DepthStencil 

The chain buffers can be bound as depth and/or stencil buffers.

Misc flags overriding particular behaviors of a texture swap chain.

See also
ovrTextureSwapChainDesc
Enumerator
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.

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.

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

The format of a texture.

See also
ovrTextureSwapChainDesc
Enumerator
OVR_FORMAT_B5G6R5_UNORM 

Not currently supported on PC. Would require a DirectX 11.1 device.

OVR_FORMAT_B5G5R5A1_UNORM 

Not currently supported on PC. Would require a DirectX 11.1 device.

OVR_FORMAT_B4G4R4A4_UNORM 

Not currently supported on PC. Would require a DirectX 11.1 device.

OVR_FORMAT_B8G8R8A8_UNORM_SRGB 

Not supported for OpenGL applications.

OVR_FORMAT_B8G8R8X8_UNORM 

Not supported for OpenGL applications.

OVR_FORMAT_B8G8R8X8_UNORM_SRGB 

Not supported for OpenGL applications.

OVR_FORMAT_R11G11B10_FLOAT 

Introduced in v1.10.

The type of texture resource.

See also
ovrTextureSwapChainDesc
Enumerator
ovrTexture_2D 

2D textures.

ovrTexture_2D_External 

External 2D texture. Not used on PC.

ovrTexture_Cube 

Cube maps. Not currently supported on PC.

enum ovrTouch

Describes touch input types.

These values map to capacitive touch values reported ovrInputState::Touch. Some of these values are mapped to button bits for consistency.

Specifies sensor flags.

/see ovrTrackerPose

Enumerator
ovrTracker_Connected 

The sensor is present, else the sensor is absent or offline.

ovrTracker_PoseTracked 

The sensor has a valid pose, else the pose is unavailable. This will only be set if ovrTracker_Connected is set.

Tracking capability bits reported by the device.

Used with ovr_GetTrackingCaps.

Enumerator
ovrTrackingCap_Orientation 

Supports orientation tracking (IMU).

ovrTrackingCap_MagYawCorrection 

Supports yaw drift correction via a magnetometer or other means.

ovrTrackingCap_Position 

Supports positional tracking.

Specifies the coordinate system ovrTrackingState returns tracking poses in.

Used with ovr_SetTrackingOriginType()

Enumerator
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 ovrTrackingState are reported as an offset transform from the profile calibrated or recentered HMD pose. It is recommended that apps using this origin type call ovr_RecenterTrackingOrigin prior 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.

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 ovrTrackingState are reported as an offset transform from the profile calibrated floor pose. Calling ovr_RecenterTrackingOrigin will 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.

Function Documentation

void ovr_ClearShouldRecenterFlag ( ovrSession  session)

Clears the ShouldRecenter status bit in ovrSessionStatus.

Clears the ShouldRecenter status bit in ovrSessionStatus, allowing further recenter requests to be detected. Since this is automatically done by ovr_RecenterTrackingOrigin, this is only needs to be called when application is doing its own re-centering.

ovrResult ovr_CommitTextureSwapChain ( ovrSession  session,
ovrTextureSwapChain  chain 
)

Commits any pending changes to an ovrTextureSwapChain, and advances its current index.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]chainSpecifies the ovrTextureSwapChain to commit.
Note
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.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. Failures include but aren't limited to:
  • ovrError_TextureSwapChainFull: ovr_CommitTextureSwapChain was called too many times on a texture swapchain without calling submit to use the chain.
See also
ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
ovrResult ovr_Create ( ovrSession pSession,
ovrGraphicsLuid pLuid 
)

Creates a handle to a VR session.

Upon success the returned ovrSession must be eventually freed with ovr_Destroy when it is no longer needed. A second call to ovr_Create will result in an error return value if the previous session has not been destroyed.

Parameters
[out]pSessionProvides a pointer to an ovrSession which will be written to upon success.
[out]luidProvides 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
Returns an ovrResult indicating success or failure. Upon failure the returned ovrSession will be NULL.

Example code

ovrSession session;
ovrResult result = ovr_Create(&session, &luid);
if(OVR_FAILURE(result))
...
See also
ovr_Destroy
void ovr_Destroy ( ovrSession  session)

Destroys the session.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
See also
ovr_Create
void ovr_DestroyMirrorTexture ( ovrSession  session,
ovrMirrorTexture  mirrorTexture 
)

MirrorTexture creation is rendering API-specific.

ovr_CreateMirrorTextureDX and ovr_CreateMirrorTextureGL can be found in the rendering API-specific headers, such as OVR_CAPI_D3D.h and OVR_CAPI_GL.h Destroys a mirror texture previously created by one of the mirror texture creation functions.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]mirrorTextureSpecifies the ovrTexture to destroy. If it is NULL then this function has no effect.
See also
ovr_CreateMirrorTextureDX, ovr_CreateMirrorTextureGL
void ovr_DestroyTextureSwapChain ( ovrSession  session,
ovrTextureSwapChain  chain 
)

Destroys an ovrTextureSwapChain and frees all the resources associated with it.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]chainSpecifies the ovrTextureSwapChain to destroy. If it is NULL then this function has no effect.
See also
ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
ovrBool ovr_GetBool ( ovrSession  session,
const char *  propertyName,
ovrBool  defaultVal 
)

Reads a boolean property.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid for only the call.
[in]defaultValspecifes the value to return if the property couldn't be read.
Returns
Returns the property interpreted as a boolean value. Returns defaultVal if the property doesn't exist.
ovrResult ovr_GetBoundaryDimensions ( ovrSession  session,
ovrBoundaryType  boundaryType,
ovrVector3f outDimensions 
)

Gets the dimension of the Boundary System's "play area" or "outer boundary".

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]boundaryTypeMust be either ovrBoundary_Outer or ovrBoundary_PlayArea.
[out]dimensionsDimensions of the axis aligned bounding box that encloses the area in meters (width, height and length).
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
  • ovrSuccess: The call succeeded and a result was returned.
  • ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due to not being set up.
ovrResult ovr_GetBoundaryGeometry ( ovrSession  session,
ovrBoundaryType  boundaryType,
ovrVector3f outFloorPoints,
int *  outFloorPointsCount 
)

Gets the geometry of the Boundary System's "play area" or "outer boundary" as 3D floor points.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]boundaryTypeMust be either ovrBoundary_Outer or ovrBoundary_PlayArea.
[out]outFloorPointsArray of 3D points (in clockwise order) defining the boundary at floor height (can be NULL to retrieve only the number of points).
[out]outFloorPointsCountNumber of 3D points returned in the array.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
  • ovrSuccess: The call succeeded and a result was returned.
  • ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due to not being set up.
ovrResult ovr_GetBoundaryVisible ( ovrSession  session,
ovrBool outIsVisible 
)

Returns if the boundary is currently visible.

Note: visibility is false if the user has turned off boundaries, otherwise, it's true if the app has requested boundaries to be visible or if any tracked device is currently triggering it. This may not exactly match rendering due to fade-in and fade-out effects.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[out]outIsVisibleovrTrue, if the boundary is visible.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
  • ovrSuccess: Result was successful and a result was returned.
  • ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due to not being set up.
unsigned int ovr_GetConnectedControllerTypes ( ovrSession  session)

Returns controller types connected to the system OR'ed together.

Returns
A bitmask of ovrControllerTypes connected to the system.
See also
ovrControllerType
ovrResult ovr_GetControllerVibrationState ( ovrSession  session,
ovrControllerType  controllerType,
ovrHapticsPlaybackState outState 
)

Gets the Haptics engine playback state of a specific Touch controller.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]controllerTypeController where the Haptics buffer wil be played.
[in]outStateState of the haptics engine.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
  • ovrSuccess: The call succeeded and a result was returned.
  • ovrSuccess_DeviceUnavailable: The call succeeded but the device referred to by controllerType is not available.
See also
ovrHapticsPlaybackState
float ovr_GetFloat ( ovrSession  session,
const char *  propertyName,
float  defaultVal 
)

Reads a float property.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid only for the call.
[in]defaultValspecifes the value to return if the property couldn't be read.
Returns
Returns the property interpreted as an float value. Returns defaultVal if the property doesn't exist.
unsigned int ovr_GetFloatArray ( ovrSession  session,
const char *  propertyName,
float  values[],
unsigned int  valuesCapacity 
)

Reads a float array property.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid only for the call.
[in]valuesAn array of float to write to.
[in]valuesCapacitySpecifies the maximum number of elements to write to the values array.
Returns
Returns the number of elements read, or 0 if property doesn't exist or is empty.
ovrSizei ovr_GetFovTextureSize ( ovrSession  session,
ovrEyeType  eye,
ovrFovPort  fov,
float  pixelsPerDisplayPixel 
)

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.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]eyeSpecifies which eye (left or right) to calculate for.
[in]fovSpecifies the ovrFovPort to use.
[in]pixelsPerDisplayPixelSpecifies 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.

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);
Returns
Returns the texture width and height size.
ovrHmdDesc ovr_GetHmdDesc ( ovrSession  session)

Returns information about the current HMD.

ovr_Initialize must have first been called in order for this to succeed, otherwise ovrHmdDesc::Type will be reported as ovrHmd_None.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create, else NULL in which case this function detects whether an HMD is present and returns its info if so.
Returns
Returns an ovrHmdDesc. If the hmd is NULL and ovrHmdDesc::Type is ovrHmd_None then no HMD is present.
ovrResult ovr_GetInputState ( ovrSession  session,
ovrControllerType  controllerType,
ovrInputState inputState 
)

Returns the most recent input state for controllers, without positional tracking info.

Parameters
[out]inputStateInput state that will be filled in.
[in]ovrControllerTypeSpecifies which controller the input will be returned for.
Returns
Returns ovrSuccess if the new state was successfully obtained.
See also
ovrControllerType
int ovr_GetInt ( ovrSession  session,
const char *  propertyName,
int  defaultVal 
)

Reads an integer property.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid only for the call.
[in]defaultValSpecifes the value to return if the property couldn't be read.
Returns
Returns the property interpreted as an integer value. Returns defaultVal if the property doesn't exist.
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, ovr_GetLastErrorInfo should be called immediately after an API function that returned a failed ovrResult, with no other API functions called in the interim.

Parameters
[out]errorInfoThe last ovrErrorInfo for the current thread.
See also
ovrErrorInfo
ovrResult ovr_GetPerfStats ( ovrSession  session,
ovrPerfStats outStats 
)

Retrieves performance stats for the VR app as well as the SDK compositor.

If the app calling this function is not the one in focus (i.e. not visible in the HMD), then outStats will be zero'd out. New stats are populated after each successive call to ovr_SubmitFrame. So the app should call this function on the same thread it calls ovr_SubmitFrame, preferably immediately afterwards.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[out]outStatsContains the performance stats for the application and SDK compositor
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success.
See also
ovrPerfStats, ovrPerfStatsPerCompositorFrame, ovr_ResetPerfStats
double ovr_GetPredictedDisplayTime ( ovrSession  session,
long 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 relevant 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 even 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
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]frameIndexIdentifies the frame the caller wishes to target. A value of zero returns the next frame index.
Returns
Returns the absolute frame midpoint time for the given frameIndex.
See also
ovr_GetTimeInSeconds
ovrEyeRenderDesc ovr_GetRenderDesc ( ovrSession  session,
ovrEyeType  eyeType,
ovrFovPort  fov 
)

Computes the distortion viewport, view adjust, and other rendering parameters for the specified eye.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]eyeTypeSpecifies which eye (left or right) for which to perform calculations.
[in]fovSpecifies the ovrFovPort to use.
Returns
Returns the computed ovrEyeRenderDesc for the given eyeType and field of view.
See also
ovrEyeRenderDesc
ovrResult ovr_GetSessionStatus ( ovrSession  session,
ovrSessionStatus sessionStatus 
)

Returns status information for the application.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[out]sessionStatusProvides an ovrSessionStatus that is filled in.
Returns
Returns an ovrResult indicating success or failure. In the case of failure, use ovr_GetLastErrorInfo to get more information. - ovrSuccess: Completed successfully.
  • ovrError_ServiceConnection: The service connection was lost and the application
const char* ovr_GetString ( ovrSession  session,
const char *  propertyName,
const char *  defaultVal 
)

Reads a string property.

Strings are UTF8-encoded and null-terminated.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid only for the call.
[in]defaultValSpecifes the value to return if the property couldn't be read.
Returns
Returns the string property if it exists. Otherwise returns defaultVal, which can be specified as NULL. The return memory is guaranteed to be valid until next call to ovr_GetString or until the session is destroyed, whichever occurs first.
ovrResult ovr_GetTextureSwapChainCurrentIndex ( ovrSession  session,
ovrTextureSwapChain  chain,
int *  out_Index 
)

Gets the current index in an ovrTextureSwapChain.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]chainSpecifies the ovrTextureSwapChain for which the index should be retrieved.
[out]out_IndexReturns the current (free) index in specified chain.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error.
See also
ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
ovrResult ovr_GetTextureSwapChainDesc ( ovrSession  session,
ovrTextureSwapChain  chain,
ovrTextureSwapChainDesc out_Desc 
)

Gets the description of the buffers in an ovrTextureSwapChain.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]chainSpecifies the ovrTextureSwapChain for which the description should be retrieved.
[out]out_DescReturns the description of the specified chain.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error.
See also
ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
ovrResult ovr_GetTextureSwapChainLength ( ovrSession  session,
ovrTextureSwapChain  chain,
int *  out_Length 
)

TextureSwapChain creation is rendering API-specific.

ovr_CreateTextureSwapChainDX and ovr_CreateTextureSwapChainGL can be found in the rendering API-specific headers, such as OVR_CAPI_D3D.h and OVR_CAPI_GL.h Gets the number of buffers in an ovrTextureSwapChain.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]chainSpecifies the ovrTextureSwapChain for which the length should be retrieved.
[out]out_LengthReturns the number of buffers in the specified chain.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error.
See also
ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
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
Returns seconds as a floating point value.
See also
ovrPoseStatef, ovrFrameTiming
ovrTouchHapticsDesc ovr_GetTouchHapticsDesc ( ovrSession  session,
ovrControllerType  controllerType 
)

Gets information about Haptics engine for the specified Touch controller.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]controllerTypeThe controller to retrieve the information from.
Returns
Returns an ovrTouchHapticsDesc.
unsigned int ovr_GetTrackerCount ( ovrSession  session)

Returns the number of attached trackers.

The number of trackers may change at any time, so this function should be called before use as opposed to once on startup.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
Returns
Returns unsigned int count.
ovrTrackerDesc ovr_GetTrackerDesc ( ovrSession  session,
unsigned int  trackerDescIndex 
)

Returns a given attached tracker description.

ovr_Initialize must have first been called in order for this to succeed, otherwise the returned trackerDescArray will be zero-initialized. The data returned by this function can change at runtime.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]trackerDescIndexSpecifies a tracker index. The valid indexes are in the range of 0 to the tracker count returned by ovr_GetTrackerCount.
Returns
Returns ovrTrackerDesc. An empty ovrTrackerDesc will be returned if trackerDescIndex is out of range.
See also
ovrTrackerDesc, ovr_GetTrackerCount
ovrTrackerPose ovr_GetTrackerPose ( ovrSession  session,
unsigned int  trackerPoseIndex 
)

Returns the ovrTrackerPose for the given attached tracker.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]trackerPoseIndexIndex of the tracker being requested.
Returns
Returns the requested ovrTrackerPose. An empty ovrTrackerPose will be returned if trackerPoseIndex is out of range.
See also
ovr_GetTrackerCount
ovrTrackingOrigin ovr_GetTrackingOriginType ( ovrSession  session)

Gets the tracking origin state.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
Returns
Returns the ovrTrackingOrigin that was either set by default, or previous set by the application.
See also
ovrTrackingOrigin, ovr_SetTrackingOriginType
ovrTrackingState ovr_GetTrackingState ( ovrSession  session,
double  absTime,
ovrBool  latencyMarker 
)

Returns tracking state reading based on the specified absolute system time.

Pass an absTime value of 0.0 to request the most recent sensor reading. In this case both PredictedPose and SamplePose will 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
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]absTimeSpecifies the absolute future time to predict the return ovrTrackingState value. Use 0 to request the most recent tracking state.
[in]latencyMarkerSpecifies that this call is the point in time where the "App-to-Mid-Photon" latency timer starts from. If a given ovrLayer provides "SensorSampleTime", that will override the value stored here.
Returns
Returns the ovrTrackingState that is predicted for the given absTime.
See also
ovrTrackingState, ovr_GetEyePoses, ovr_GetTimeInSeconds
const char* ovr_GetVersionString ( )

Returns the version string representing the LibOVRRT version.

The returned string pointer is valid until the next call to ovr_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
Returns a UTF8-encoded null-terminated version string.
ovrResult ovr_IdentifyClient ( const char *  identity)

Identify client application info.

The string is one or more newline-delimited lines of optional info indicating engine name, engine version, engine plugin name, engine plugin version, engine editor. The order of the lines is not relevant. Individual lines are optional. A newline is not necessary at the end of the last line. Call after ovr_Initialize and before the first call to ovr_Create. Each value is limited to 20 characters. Key names such as 'EngineName:' 'EngineVersion:' do not count towards this limit.

Parameters
[in]identitySpecifies one or more newline-delimited lines of optional info: EngineName: s
EngineVersion: s
EnginePluginName: s
EnginePluginVersion: s
EngineEditor: <boolean> ('true' or 'false')
Example code
ovr_IdentifyClient("EngineName: Unity\n"
"EngineVersion: 5.3.3\n"
"EnginePluginName: OVRPlugin\n"
"EnginePluginVersion: 1.2.0\n"
"EngineEditor: true");
ovrResult ovr_Initialize ( const ovrInitParams params)

Initializes LibOVR.

Initialize LibOVR for application usage. This includes finding and loading the LibOVRRT shared library. No LibOVR API functions, other than ovr_GetLastErrorInfo and ovr_Detect, can be called unless ovr_Initialize succeeds. A successful call to ovr_Initialize must be eventually followed by a call to ovr_Shutdown. ovr_Initialize calls are idempotent. Calling ovr_Initialize twice does not require two matching calls to ovr_Shutdown. If already initialized, the return value is ovr_Success.

LibOVRRT shared library search order:

  1. Current working directory (often the same as the application directory).
  2. Module directory (usually the same as the application directory, but not if the module is a separate shared library).
  3. Application directory
  4. Development directory (only if OVR_ENABLE_DEVELOPER_SEARCH is enabled, which is off by default).
  5. Standard OS shared library search location(s) (OS-specific).
Parameters
paramsSpecifies custom initialization options. May be NULL to indicate default options when using the CAPI shim. If you are directly calling the LibOVRRT version of ovr_Initialize
Returns
Returns an ovrResult indicating success or failure. In the case of failure, use ovr_GetLastErrorInfo to get more information. Example failed results include:
  • ovrError_Initialize: Generic initialization error.
  • ovrError_LibLoad: Couldn't load LibOVRRT.
  • ovrError_LibVersion: LibOVRRT version incompatibility.
  • ovrError_ServiceConnection: Couldn't connect to the OVR Service.
  • ovrError_ServiceVersion: OVR Service version incompatibility.
  • ovrError_IncompatibleOS: The operating system version is incompatible.
  • ovrError_DisplayInit: Unable to initialize the HMD display.
  • ovrError_ServerStart: Unable to start the server. Is it already running?
  • ovrError_Reinitialization: Attempted to re-initialize with a different version.

Example code

ovrInitParams initParams = { ovrInit_RequestVersion, OVR_MINOR_VERSION, NULL, 0, 0 };
ovrResult result = ovr_Initialize(&initParams);
if(OVR_FAILURE(result)) {
ovrErrorInfo errorInfo;
ovr_GetLastErrorInfo(&errorInfo);
DebugLog("ovr_Initialize failed: %s", errorInfo.ErrorString);
return false;
}
[...]
See also
ovr_Shutdown
ovrResult ovr_RecenterTrackingOrigin ( ovrSession  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 ovrTrackerPoses then you will need to call ovr_GetTrackerPose after 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 ovrError_InvalidHeadsetOrientation.

For more info, see the notes on each ovrTrackingOrigin enumeration to understand how recenter will vary slightly in its behavior based on the current ovrTrackingOrigin setting.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
Returns
Returns an ovrResult indicating success or failure. In the case of failure, use ovr_GetLastErrorInfo to get more information. Return values include but aren't limited to:
  • ovrSuccess: Completed successfully.
  • ovrError_InvalidHeadsetOrientation: The headset was facing an invalid direction when attempting recentering, such as facing vertically.
See also
ovrTrackingOrigin, ovr_GetTrackerPose
ovrResult ovr_RequestBoundaryVisible ( ovrSession  session,
ovrBool  visible 
)

Requests boundary to be visible.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]visibleforces the outer boundary to be visible. An application can't force it to be invisible, but can cancel its request by passing false.
Returns
Returns ovrSuccess upon success.
ovrResult ovr_ResetBoundaryLookAndFeel ( ovrSession  session)

Resets the look and feel of the Boundary System to its default state.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
Returns
Returns ovrSuccess upon success.
See also
ovrBoundaryLookAndFeel
ovrResult ovr_ResetPerfStats ( ovrSession  session)

Resets the accumulated stats reported in each ovrPerfStatsPerCompositorFrame back to zero.

Only the integer values such as HmdVsyncIndex, AppDroppedFrameCount etc. will be reset as the other fields such as AppMotionToPhotonLatency are independent timing values updated per-frame.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success.
See also
ovrPerfStats, ovrPerfStatsPerCompositorFrame, ovr_GetPerfStats
ovrBool ovr_SetBool ( ovrSession  session,
const char *  propertyName,
ovrBool  value 
)

Writes or creates a boolean property.

If the property wasn't previously a boolean property, it is changed to a boolean property.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid only for the call.
[in]valueThe value to write.
Returns
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.
ovrResult ovr_SetBoundaryLookAndFeel ( ovrSession  session,
const ovrBoundaryLookAndFeel lookAndFeel 
)

Sets the look and feel of the Boundary System.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]lookAndFeelLook and feel parameters.
Returns
Returns ovrSuccess upon success.
See also
ovrBoundaryLookAndFeel
ovrResult ovr_SetControllerVibration ( ovrSession  session,
ovrControllerType  controllerType,
float  frequency,
float  amplitude 
)

Sets constant vibration (with specified frequency and amplitude) to a controller.

Note: ovr_SetControllerVibration cannot be used interchangeably with ovr_SubmitControllerVibration.

This method should be called periodically, vibration lasts for a maximum of 2.5 seconds.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]controllerTypeThe controller to set the vibration to.
[in]frequencyVibration frequency. Supported values are: 0.0 (disabled), 0.5 and 1.0. Non valid values will be clamped.
[in]amplitudeVibration amplitude in the [0.0, 1.0] range.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
  • ovrSuccess: The call succeeded and a result was returned.
  • ovrSuccess_DeviceUnavailable: The call succeeded but the device referred to by controllerType is not available.
ovrBool ovr_SetFloat ( ovrSession  session,
const char *  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
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid only for the call.
[in]valueThe value to write.
Returns
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.
ovrBool ovr_SetFloatArray ( ovrSession  session,
const char *  propertyName,
const float  values[],
unsigned int  valuesSize 
)

Writes or creates a float array property.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid only for the call.
[in]valuesAn array of float to write from.
[in]valuesSizeSpecifies the number of elements to write.
Returns
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.
ovrBool ovr_SetInt ( ovrSession  session,
const char *  propertyName,
int  value 
)

Writes or creates an integer property.

If the property wasn't previously a boolean property, it is changed to an integer property.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid only for the call.
[in]valueThe value to write.
Returns
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.
ovrBool ovr_SetString ( ovrSession  session,
const char *  propertyName,
const char *  value 
)

Writes or creates a string property.

Strings are UTF8-encoded and null-terminated.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]propertyNameThe name of the property, which needs to be valid only for the call.
[in]valueThe string property, which only needs to be valid for the duration of the call.
Returns
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.
ovrResult ovr_SetTrackingOriginType ( ovrSession  session,
ovrTrackingOrigin  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.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]originSpecifies an ovrTrackingOrigin to be used for all ovrPosef
Returns
Returns an ovrResult indicating success or failure. In the case of failure, use ovr_GetLastErrorInfo to get more information.
See also
ovrTrackingOrigin, ovr_GetTrackingOriginType
void ovr_Shutdown ( )

Shuts down LibOVR.

A successful call to ovr_Initialize must be eventually matched by a call to ovr_Shutdown. After calling ovr_Shutdown, no LibOVR functions can be called except ovr_GetLastErrorInfo or another ovr_Initialize. ovr_Shutdown invalidates all pointers, references, and created objects previously returned by LibOVR functions. The LibOVRRT shared library can be unloaded by ovr_Shutdown.

See also
ovr_Initialize
ovrResult ovr_SubmitControllerVibration ( ovrSession  session,
ovrControllerType  controllerType,
const ovrHapticsBuffer buffer 
)

Submits a Haptics buffer (used for vibration) to Touch (only) controllers.

Note: ovr_SubmitControllerVibration cannot be used interchangeably with ovr_SetControllerVibration.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]controllerTypeController where the Haptics buffer will be played.
[in]bufferHaptics buffer containing amplitude samples to be played.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
  • ovrSuccess: The call succeeded and a result was returned.
  • ovrSuccess_DeviceUnavailable: The call succeeded but the device referred to by controllerType is not available.
See also
ovrHapticsBuffer
ovrResult ovr_SubmitFrame ( ovrSession  session,
long long  frameIndex,
const ovrViewScaleDesc viewScaleDesc,
ovrLayerHeader const *const *  layerPtrList,
unsigned int  layerCount 
)

Submits layers for distortion and display.

ovr_SubmitFrame triggers 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.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]frameIndexSpecifies the targeted application frame index, or 0 to refer to one frame after the last time ovr_SubmitFrame was called.
[in]viewScaleDescProvides additional information needed only if layerPtrList contains an ovrLayerType_Quad. If NULL, a default version is used based on the current configuration and a 1.0 world scale.
[in]layerPtrListSpecifies a list of ovrLayer pointers, which can include NULL entries 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 as ovrLayerEyeFov or ovrLayerQuad, with Header.Type identifying its type. A NULL layerPtrList entry in the array indicates the
[in]layerCountIndicates the number of valid elements in layerPtrList. The maximum supported layerCount is not currently specified, but may be specified in a future version.
  • 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 to ovr_SubmitFrame or it won't be displayed.
  • If a layerPtrList entry that was specified in a previous call to ovr_SubmitFrame is passed as NULL or is of type ovrLayerType_Disabled, that layer is no longer displayed.
  • A layerPtrList entry can be of any layer type and multiple entries of the same layer type are allowed. No layerPtrList entry may be duplicated (i.e. the same pointer as an earlier entry).

Example code

ovrLayerQuad layer1;
...
ovrLayerHeader* layers[2] = { &layer0.Header, &layer1.Header };
ovrResult result = ovr_SubmitFrame(session, frameIndex, nullptr, layers, 2);
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
  • ovrSuccess: rendering completed successfully.
  • ovrSuccess_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 call ovr_SubmitFrame periodically until it returns a value other than ovrSuccess_NotVisible.
  • ovrError_DisplayLost: The session has become invalid (such as due to a device removal) and the shared resources need to be released (ovr_DestroyTextureSwapChain), the session needs to destroyed (ovr_Destroy) and recreated (ovr_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 new ovr_Create call returns a different GraphicsLuid.
  • ovrError_TextureSwapChainInvalid: The ovrTextureSwapChain is in an incomplete or inconsistent state. Ensure ovr_CommitTextureSwapChain was called at least once first.
See also
ovr_GetPredictedDisplayTime, ovrViewScaleDesc, ovrLayerHeader
ovrResult ovr_TestBoundary ( ovrSession  session,
ovrTrackedDeviceType  deviceBitmask,
ovrBoundaryType  boundaryType,
ovrBoundaryTestResult outTestResult 
)

Tests collision/proximity of position tracked devices (e.g.

HMD and/or Touch) against the Boundary System. Note: this method is similar to ovr_BoundaryTestPoint but can be more precise as it may take into account device acceleration/momentum.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]deviceBitmaskBitmask of one or more tracked devices to test.
[in]boundaryTypeMust be either ovrBoundary_Outer or ovrBoundary_PlayArea.
[out]outTestResultResult of collision/proximity test, contains information such as distance and closest point.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
  • ovrSuccess: The call succeeded and a result was returned.
  • ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due to not being set up.
  • ovrSuccess_DeviceUnavailable: The call succeeded but the device referred to by deviceBitmask is not available.
See also
ovrBoundaryTestResult
ovrResult ovr_TestBoundaryPoint ( ovrSession  session,
const ovrVector3f point,
ovrBoundaryType  singleBoundaryType,
ovrBoundaryTestResult outTestResult 
)

Tests collision/proximity of a 3D point against the Boundary System.

Parameters
[in]sessionSpecifies an ovrSession previously returned by ovr_Create.
[in]point3D point to test.
[in]singleBoundaryTypeMust be either ovrBoundary_Outer or ovrBoundary_PlayArea to test against
[out]outTestResultResult of collision/proximity test, contains information such as distance and closest point.
Returns
Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
  • ovrSuccess: The call succeeded and a result was returned.
  • ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due to not being set up.
See also
ovrBoundaryTestResult
int ovr_TraceMessage ( int  level,
const char *  message 
)

Writes a message string to the LibOVR tracing mechanism (if enabled).

This message will be passed back to the application via the ovrLogCallback if it was registered.

Parameters
[in]levelOne of the ovrLogLevel constants.
[in]messageA UTF8-encoded null-terminated string.
Returns
returns the strlen of the message or a negative value if the message is too large.
See also
ovrLogLevel, ovrLogCallback