HMD Management

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

Tracking

ovrResult
Sets the tracking origin type.
ovrTrackingOrigin
Gets the tracking origin state.
ovrResult
Re-centers the sensor position and orientation.
ovrResult
Allows manually tweaking the sensor position and orientation.
void
Clears the ShouldRecenter status bit in ovrSessionStatus.
ovrTrackingState
ovr_GetTrackingState ( ovrSession session, double absTime, ovrBool latencyMarker )
Returns tracking state reading based on the specified absolute system time.
ovrResult
ovr_GetDevicePoses ( ovrSession session, ovrTrackedDeviceType * deviceTypes, int deviceCount, double absTime, ovrPoseStatef * outDevicePoses )
Returns an array of poses, where each pose matches a device type provided by the deviceTypes array parameter.
ovrTrackerPose
ovr_GetTrackerPose ( ovrSession session, unsigned int trackerPoseIndex )
Returns the ovrTrackerPose for the given attached tracker.
ovrResult
ovr_GetInputState ( ovrSession session, ovrControllerType controllerType, ovrInputState * inputState )
Returns the most recent input state for controllers, without positional tracking info.
unsigned int
Returns controller types connected to the system OR'ed together.
ovrTouchHapticsDesc
Gets information about Haptics engine for the specified Touch controller.
ovrResult
ovr_SetControllerVibration ( ovrSession session, ovrControllerType controllerType, float frequency, float amplitude )
Sets constant vibration (with specified frequency and amplitude) to a controller.
ovrResult
ovr_SubmitControllerVibration ( ovrSession session, ovrControllerType controllerType, const ovrHapticsBuffer * buffer )
Submits a Haptics buffer (used for vibration) to Touch (only) controllers.
ovrResult
Gets the Haptics engine playback state of a specific Touch controller.
ovrResult
ovr_TestBoundary ( ovrSession session, ovrTrackedDeviceType deviceBitmask, ovrBoundaryType boundaryType, ovrBoundaryTestResult * outTestResult )
Tests collision/proximity of position tracked devices (e.g.
ovrResult
ovr_TestBoundaryPoint ( ovrSession session, const ovrVector3f * point, ovrBoundaryType singleBoundaryType, ovrBoundaryTestResult * outTestResult )
Tests collision/proximity of a 3D point against the Boundary System.
ovrResult
Sets the look and feel of the Boundary System.
ovrResult
Resets the look and feel of the Boundary System to its default state.
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.
ovrResult
ovr_GetBoundaryDimensions ( ovrSession session, ovrBoundaryType boundaryType, ovrVector3f * outDimensions )
Gets the dimension of the Boundary System's "play area" or "outer boundary".
ovrResult
ovr_GetBoundaryVisible ( ovrSession session, ovrBool * outIsVisible )
Returns if the boundary is currently visible.
ovrResult
Requests boundary to be visible.

User Defined

enum
@0 {
}
Specifies the maximum number of layers supported by ovr_SubmitFrame.
enum
ovrLayerType {
}
Describes layer types that can be passed to ovr_SubmitFrame.
enum
ovrLayerFlags {
}
Identifies flags used by ovrLayerHeader and which are passed to ovr_SubmitFrame.

SDK Distortion Rendering

ovrResult
ovr_GetTextureSwapChainLength ( ovrSession session, ovrTextureSwapChain chain, int * out_Length )
TextureSwapChain creation is rendering API-specific.
ovrResult
ovr_GetTextureSwapChainCurrentIndex ( ovrSession session, ovrTextureSwapChain chain, int * out_Index )
Gets the current index in an ovrTextureSwapChain.
ovrResult
ovr_GetTextureSwapChainDesc ( ovrSession session, ovrTextureSwapChain chain, ovrTextureSwapChainDesc * out_Desc )
Gets the description of the buffers in an ovrTextureSwapChain.
ovrResult
ovr_CommitTextureSwapChain ( ovrSession session, ovrTextureSwapChain chain )
Commits any pending changes to an ovrTextureSwapChain, and advances its current index.
void
ovr_DestroyTextureSwapChain ( ovrSession session, ovrTextureSwapChain chain )
Destroys an ovrTextureSwapChain and frees all the resources associated with it.
void
ovr_DestroyMirrorTexture ( ovrSession session, ovrMirrorTexture mirrorTexture )
MirrorTexture creation is rendering API-specific.
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.
ovrEyeRenderDesc
Computes the distortion viewport, view adjust, and other rendering parameters for the specified eye.
ovrResult
ovr_SubmitFrame ( ovrSession session, long long frameIndex, const ovrViewScaleDesc * viewScaleDesc, ovrLayerHeader const *const * layerPtrList, unsigned int layerCount )
Submits layers for distortion and display.

Frame Timing

enum
@1 {
}
Maximum number of frames of performance stats provided back to the caller of ovr_GetPerfStats.
enum
ovrPerfHudMode {
}
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.
enum
ovrLayerHudMode {
}
Layer HUD enables the HMD user to see information about a layer.
ovrResult
ovr_GetPerfStats ( ovrSession session, ovrPerfStats * outStats )
Retrieves performance stats for the VR app as well as the SDK compositor.
ovrResult
Resets the accumulated stats reported in each ovrPerfStatsPerCompositorFrame back to zero.
double
ovr_GetPredictedDisplayTime ( ovrSession session, long long frameIndex )
Gets the time of the specified frame midpoint.
double
Returns global, absolute high-resolution time in seconds.

Mixed reality capture support

ovrResult
ovr_GetExternalCameras ( ovrSession session, ovrExternalCamera * cameras, unsigned int * inoutCameraCount )
Returns the number of camera properties of all cameras.
ovrResult
ovr_SetExternalCameraProperties ( ovrSession session, const char * name, const ovrCameraIntrinsics *const intrinsics, const ovrCameraExtrinsics *const extrinsics )
Sets the camera intrinsics and/or extrinsics stored for the cameraName camera Names must be < 32 characters and null-terminated.

Property Access

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

Macros

#define
OVR_OS_WIN32
#define
OVR_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
Provided for backward compatibility with older versions of this library.
#define
OVR_SA_UNUSED
#define
OVR_SA_PASTE
#define
OVR_SA_HELP
#define
OVR_STATIC_ASSERT
#define
OVR_UNUSED_STRUCT_PAD
Defines explicitly unused space for a struct.
#define
OVR_PTR_SIZE
Specifies the size of a pointer on the given platform.
#define
OVR_ON32
#define
OVR_ON64
#define
ovrFalse
ovrBool value of false.
#define
ovrTrue
ovrBool value of true.
#define
VK_DEFINE_HANDLE
Fallback definitions for when the vulkan header isn't being included.
#define
VK_DEFINE_NON_DISPATCHABLE_HANDLE
#define
OVR_HAPTICS_BUFFER_SAMPLES_MAX
Maximum number of samples in ovrHapticsBuffer.
#define
OVR_EXTERNAL_CAMERA_NAME_SIZE

Enumerations

enum
ovrHmdType {
}
Enumerates all HMD types that we support.
enum
ovrHmdCaps {
}
HMD capability bits reported by device.
enum
ovrTrackingCaps {
}
Tracking capability bits reported by the device.
enum
ovrEyeType {
}
Specifies which eye is being used for rendering.
enum
ovrTrackingOrigin {
}
Specifies the coordinate system ovrTrackingState returns tracking poses in.
enum
ovrStatusBits {
}
Bit flags describing the current status of sensor tracking.
enum
ovrTrackerFlags {
}
Specifies sensor flags.
enum
ovrTextureType {
}
The type of texture resource.
enum
ovrTextureBindFlags {
}
The bindings required for texture swap chain.
enum
ovrTextureFormat {
ovrTextureFormat.OVR_FORMAT_UNKNOWN = 0, ovrTextureFormat.OVR_FORMAT_B5G6R5_UNORM = 1, ovrTextureFormat.OVR_FORMAT_B5G5R5A1_UNORM = 2, ovrTextureFormat.OVR_FORMAT_B4G4R4A4_UNORM = 3, ovrTextureFormat.OVR_FORMAT_R8G8B8A8_UNORM = 4, ovrTextureFormat.OVR_FORMAT_R8G8B8A8_UNORM_SRGB = 5, ovrTextureFormat.OVR_FORMAT_B8G8R8A8_UNORM = 6, ovrTextureFormat.OVR_FORMAT_B8G8R8A8_UNORM_SRGB = 7, ovrTextureFormat.OVR_FORMAT_B8G8R8X8_UNORM = 8, ovrTextureFormat.OVR_FORMAT_B8G8R8X8_UNORM_SRGB = 9, ovrTextureFormat.OVR_FORMAT_R16G16B16A16_FLOAT = 10, ovrTextureFormat.OVR_FORMAT_R11G11B10_FLOAT = 25, ovrTextureFormat.OVR_FORMAT_D16_UNORM = 11, ovrTextureFormat.OVR_FORMAT_D24_UNORM_S8_UINT = 12, ovrTextureFormat.OVR_FORMAT_D32_FLOAT = 13, ovrTextureFormat.OVR_FORMAT_D32_FLOAT_S8X24_UINT = 14, ovrTextureFormat.OVR_FORMAT_BC1_UNORM = 15, ovrTextureFormat.OVR_FORMAT_BC1_UNORM_SRGB = 16, ovrTextureFormat.OVR_FORMAT_BC2_UNORM = 17, ovrTextureFormat.OVR_FORMAT_BC2_UNORM_SRGB = 18, ovrTextureFormat.OVR_FORMAT_BC3_UNORM = 19, ovrTextureFormat.OVR_FORMAT_BC3_UNORM_SRGB = 20, ovrTextureFormat.OVR_FORMAT_BC6H_UF16 = 21, ovrTextureFormat.OVR_FORMAT_BC6H_SF16 = 22, ovrTextureFormat.OVR_FORMAT_BC7_UNORM = 23, ovrTextureFormat.OVR_FORMAT_BC7_UNORM_SRGB = 24, ovrTextureFormat.OVR_FORMAT_ENUMSIZE = 0x7fffffff
}
The format of a texture.
enum
ovrTextureFlags {
}
Misc flags overriding particular behaviors of a texture swap chain.
enum
ovrButton {
ovrButton.ovrButton_A = 0x00000001, ovrButton.ovrButton_B = 0x00000002, ovrButton.ovrButton_RThumb = 0x00000004, ovrButton.ovrButton_RShoulder = 0x00000008, ovrButton.ovrButton_X = 0x00000100, ovrButton.ovrButton_Y = 0x00000200, ovrButton.ovrButton_LThumb = 0x00000400, ovrButton.ovrButton_LShoulder = 0x00000800, ovrButton.ovrButton_Up = 0x00010000, ovrButton.ovrButton_Down = 0x00020000, ovrButton.ovrButton_Left = 0x00040000, ovrButton.ovrButton_Right = 0x00080000, ovrButton.ovrButton_Enter = 0x00100000, ovrButton.ovrButton_Back = 0x00200000, ovrButton.ovrButton_VolUp = 0x00400000, ovrButton.ovrButton_VolDown = 0x00800000, ovrButton.ovrButton_Home = 0x01000000, ovrButton.ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home, ovrButton.ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder, ovrButton.ovrButton_LMask = ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder | ovrButton_Enter, ovrButton.ovrButton_EnumSize = 0x7fffffff
}
Describes button input types.
enum
ovrTouch {
ovrTouch.ovrTouch_A = ovrButton_A, ovrTouch.ovrTouch_B = ovrButton_B, ovrTouch.ovrTouch_RThumb = ovrButton_RThumb, ovrTouch.ovrTouch_RThumbRest = 0x00000008, ovrTouch.ovrTouch_RIndexTrigger = 0x00000010, ovrTouch.ovrTouch_RButtonMask = ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RThumbRest | ovrTouch_RIndexTrigger, ovrTouch.ovrTouch_X = ovrButton_X, ovrTouch.ovrTouch_Y = ovrButton_Y, ovrTouch.ovrTouch_LThumb = ovrButton_LThumb, ovrTouch.ovrTouch_LThumbRest = 0x00000800, ovrTouch.ovrTouch_LIndexTrigger = 0x00001000, ovrTouch.ovrTouch_LButtonMask = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger, ovrTouch.ovrTouch_RIndexPointing = 0x00000020, ovrTouch.ovrTouch_RThumbUp = 0x00000040, ovrTouch.ovrTouch_LIndexPointing = 0x00002000, ovrTouch.ovrTouch_LThumbUp = 0x00004000, ovrTouch.ovrTouch_RPoseMask = ovrTouch_RIndexPointing | ovrTouch_RThumbUp, ovrTouch.ovrTouch_LPoseMask = ovrTouch_LIndexPointing | ovrTouch_LThumbUp, ovrTouch.ovrTouch_EnumSize = 0x7fffffff
}
Describes touch input types.
enum
ovrControllerType {
}
Specifies which controller is connected; multiple can be connected at once.
enum
ovrHapticsBufferSubmitMode {
}
Haptics buffer submit mode.
enum
ovrTrackedDeviceType {
}
Position tracked devices.
enum
ovrBoundaryType {
}
Boundary types that specified while using the boundary system.
enum
ovrHandType {
}
Provides names for the left and right hand array indexes.
enum
ovrCameraStatusFlags {
}
enum
ovrInitFlags {
}
Initialization flags.
enum
ovrLogLevel {
}
Logging levels.
enum
ovrDebugHudStereoMode {
}
Debug HUD is provided to help developers gauge and debug the fidelity of their app's stereo rendering characteristics.

Typedefs

char
ovrBool ( )
Boolean type.
struct ovrHmdStruct *
Used as an opaque pointer to an OVR session.
uint32_t
struct ovrTextureSwapChainData *
struct ovrMirrorTextureData *
void(OVR_CDECL *
Signature of the logging callback function pointer type.

Functions

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

Detailed Description

Copyright 2015 Oculus VR, LLC All Rights reserved.

HMD Management Documentation

ovrHmdDesc ovr_GetHmdDesc ( ovrSession session )
Returns information about the current HMD.
ovr_Initialize must be called prior to calling this function, otherwise ovrHmdDesc::Type will be set to ovrHmd_None without checking for the HMD presence. session Specifies an ovrSession previously returned by ovr_Create() or NULL. Returns an ovrHmdDesc. If invoked with NULL session argument, ovrHmdDesc::Type set to ovrHmd_None indicates that the HMD is not connected.
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. session Specifies an ovrSession previously returned by ovr_Create. 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. session Specifies an ovrSession previously returned by ovr_Create. trackerDescIndex Specifies a tracker index. The valid indexes are in the range of 0 to the tracker count returned by ovr_GetTrackerCount. Returns ovrTrackerDesc. An empty ovrTrackerDesc will be returned if trackerDescIndex is out of range. ovrTrackerDesc, ovr_GetTrackerCount
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. pSession Provides a pointer to an ovrSession which will be written to upon success. pLuid Provides 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 ovrResult indicating success or failure. Upon failure the returned ovrSession will be NULL. Example code ovrSessionsession; ovrGraphicsLuidluid; ovrResultresult=ovr_Create(&session,&luid); if(OVR_FAILURE(result)) ... ovr_Destroy
void ovr_Destroy ( ovrSession session )
Destroys the session.
session Specifies an ovrSession previously returned by ovr_Create. ovr_Create
ovrResult ovr_GetSessionStatus ( ovrSession session, ovrSessionStatus * sessionStatus )
Returns status information for the application.
session Specifies an ovrSession previously returned by ovr_Create. sessionStatus Provides an ovrSessionStatus that is filled in. 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_ServiceConnection: The service connection was lost and the application must destroy the session.

Tracking Documentation

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. session Specifies an ovrSession previously returned by ovr_Create. origin Specifies an ovrTrackingOrigin to be used for all ovrPosef Returns an ovrResult indicating success or failure. In the case of failure, use ovr_GetLastErrorInfo to get more information. ovrTrackingOrigin, ovr_GetTrackingOriginType
ovrTrackingOrigin ovr_GetTrackingOriginType ( ovrSession session )
Gets the tracking origin state.
session Specifies an ovrSession previously returned by ovr_Create. Returns the ovrTrackingOrigin that was either set by default, or previous set by the application. ovrTrackingOrigin, ovr_SetTrackingOriginType
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 of the tracking space for the HMD and controllers using the HMD's current tracking pose. If the caller requires some tweaks on top of the HMD's current tracking pose, consider using ovr_SpecifyTrackingOrigin instead.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. session Specifies an ovrSession previously returned by ovr_Create. 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. ovrTrackingOrigin, ovr_GetTrackerPose, ovr_SpecifyTrackingOrigin
ovrResult ovr_SpecifyTrackingOrigin ( ovrSession session, ovrPosef originPose )
Allows manually tweaking the sensor position and orientation.
This function is similar to ovr_RecenterTrackingOrigin in that it modifies the (x,y,z) positional components and the yaw orientation component of the tracking space for the HMD and controllers.While ovr_RecenterTrackingOrigin resets the tracking origin in reference to the HMD's current pose, ovr_SpecifyTrackingOrigin allows the caller to explicitly specify a transform for the tracking origin. This transform is expected to be an offset to the most recent recentered origin, so calling this function repeatedly with the same originPose will keep nudging the recentered origin in that direction.There are several use cases for this function. For example, if the application decides to limit the yaw, or translation of the recentered pose instead of directly using the HMD pose the application can query the current tracking state via ovr_GetTrackingState, and apply some limitations to the HMD pose because feeding this pose back into this function. Similarly, this can be used to "adjust the seating position" incrementally in apps that feature seated experiences such as cockpit-based games.This function can emulate ovr_RecenterTrackingOrigin as such: ovrTrackingState ts = ovr_GetTrackingState(session, 0.0, ovrFalse); ovr_SpecifyTrackingOrigin(session, ts.HeadPose.ThePose);The roll and pitch orientation components are determined by gravity and cannot be redefined. 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.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. session Specifies an ovrSession previously returned by ovr_Create. originPose Specifies a pose that will be used to transform the current tracking origin. 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_InvalidParameter: The heading direction in originPose was invalid, such as facing vertically. This can happen if the caller is directly feeding the pose of a position-tracked device such as an HMD or controller into this function. ovrTrackingOrigin, ovr_GetTrackerPose, ovr_RecenterTrackingOrigin
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 and ovr_SpecifyTrackingOrigin, this function only needs to be called when application is doing its own re-centering logic.
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. session Specifies an ovrSession previously returned by ovr_Create. absTime Specifies the absolute future time to predict the return ovrTrackingState value. 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 given ovrLayer provides "SensorSampleTime", that will override the value stored here. Returns the ovrTrackingState that is predicted for the given absTime. ovrTrackingState, ovr_GetEyePoses, ovr_GetTimeInSeconds
ovrResult ovr_GetDevicePoses ( ovrSession session, ovrTrackedDeviceType * deviceTypes, int deviceCount, double absTime, ovrPoseStatef * outDevicePoses )
Returns an array of poses, where each pose matches a device type provided by the deviceTypes array parameter.
session Specifies an ovrSession previously returned by ovr_Create. deviceTypes Array of device types to query for their poses. deviceCount Number of queried poses. This number must match the length of the outDevicePoses and deviceTypes array. absTime Specifies the absolute future time to predict the return ovrTrackingState value. Use 0 to request the most recent tracking state. outDevicePoses Array of poses, one for each device type in deviceTypes arrays. Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success.
ovrTrackerPose ovr_GetTrackerPose ( ovrSession session, unsigned int trackerPoseIndex )
Returns the ovrTrackerPose for the given attached tracker.
session Specifies an ovrSession previously returned by ovr_Create. trackerPoseIndex Index of the tracker being requested. Returns the requested ovrTrackerPose. An empty ovrTrackerPose will be returned if trackerPoseIndex is out of range. ovr_GetTrackerCount
ovrResult ovr_GetInputState ( ovrSession session, ovrControllerType controllerType, ovrInputState * inputState )
Returns the most recent input state for controllers, without positional tracking info.
inputState Input state that will be filled in. ovrControllerType Specifies which controller the input will be returned for. Returns ovrSuccess if the new state was successfully obtained. ovrControllerType
unsigned int ovr_GetConnectedControllerTypes ( ovrSession session )
Returns controller types connected to the system OR'ed together.
A bitmask of ovrControllerTypes connected to the system. ovrControllerType
ovrTouchHapticsDesc ovr_GetTouchHapticsDesc ( ovrSession session, ovrControllerType controllerType )
Gets information about Haptics engine for the specified Touch controller.
session Specifies an ovrSession previously returned by ovr_Create. controllerType The controller to retrieve the information from. Returns an ovrTouchHapticsDesc.
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. session Specifies an ovrSession previously returned by ovr_Create. controllerType The controller to set the vibration to. frequency Vibration frequency. Supported values are: 0.0 (disabled), 0.5 and 1.0. Non valid values will be clamped. amplitude Vibration amplitude in the [0.0, 1.0] range. 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.
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. session Specifies an ovrSession previously returned by ovr_Create. controllerType Controller where the Haptics buffer will be played. buffer Haptics buffer containing amplitude samples to be played. 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. ovrHapticsBuffer
ovrResult ovr_GetControllerVibrationState ( ovrSession session, ovrControllerType controllerType, ovrHapticsPlaybackState * outState )
Gets the Haptics engine playback state of a specific Touch controller.
session Specifies an ovrSession previously returned by ovr_Create. controllerType Controller where the Haptics buffer wil be played. outState State of the haptics engine. 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. ovrHapticsPlaybackState
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. session Specifies an ovrSession previously returned by ovr_Create. deviceBitmask Bitmask of one or more tracked devices to test. boundaryType Must be either ovrBoundary_Outer or ovrBoundary_PlayArea. outTestResult Result of collision/proximity test, contains information such as distance and closest point. 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. ovrBoundaryTestResult
ovrResult ovr_TestBoundaryPoint ( ovrSession session, const ovrVector3f * point, ovrBoundaryType singleBoundaryType, ovrBoundaryTestResult * outTestResult )
Tests collision/proximity of a 3D point against the Boundary System.
session Specifies an ovrSession previously returned by ovr_Create. point 3D point to test. singleBoundaryType Must be either ovrBoundary_Outer or ovrBoundary_PlayArea to test against outTestResult Result of collision/proximity test, contains information such as distance and closest point. 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. ovrBoundaryTestResult
ovrResult ovr_SetBoundaryLookAndFeel ( ovrSession session, const ovrBoundaryLookAndFeel * lookAndFeel )
Sets the look and feel of the Boundary System.
session Specifies an ovrSession previously returned by ovr_Create. lookAndFeel Look and feel parameters. Returns ovrSuccess upon success. ovrBoundaryLookAndFeel
ovrResult ovr_ResetBoundaryLookAndFeel ( ovrSession session )
Resets the look and feel of the Boundary System to its default state.
session Specifies an ovrSession previously returned by ovr_Create. Returns ovrSuccess upon success. ovrBoundaryLookAndFeel
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.
session Specifies an ovrSession previously returned by ovr_Create. boundaryType Must be either ovrBoundary_Outer or ovrBoundary_PlayArea. outFloorPoints Array of 3D points (in clockwise order) defining the boundary at floor height (can be NULL to retrieve only the number of points). outFloorPointsCount Number of 3D points returned in the array. 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_GetBoundaryDimensions ( ovrSession session, ovrBoundaryType boundaryType, ovrVector3f * outDimensions )
Gets the dimension of the Boundary System's "play area" or "outer boundary".
session Specifies an ovrSession previously returned by ovr_Create. boundaryType Must be either ovrBoundary_Outer or ovrBoundary_PlayArea. outDimensions Dimensions of the axis aligned bounding box that encloses the area in meters (width, height and length). 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. session Specifies an ovrSession previously returned by ovr_Create. outIsVisible ovrTrue, if the boundary is visible. 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.
ovrResult ovr_RequestBoundaryVisible ( ovrSession session, ovrBool visible )
Requests boundary to be visible.
session Specifies an ovrSession previously returned by ovr_Create. visible forces the outer boundary to be visible. An application can't force it to be invisible, but can cancel its request by passing false. Returns ovrSuccess upon success.

User Defined Documentation

enum OVR_CAPI.h.@0
Specifies the maximum number of layers supported by ovr_SubmitFrame.
Enumerator
ovrMaxLayerCount= 16
enum OVR_CAPI.h.ovrLayerType
Describes layer types that can be passed to ovr_SubmitFrame.
Enumerator
ovrLayerType_Disabled
Layer is disabled.
ovrLayerType_EyeFov
Described by ovrLayerEyeFov.
ovrLayerType_Quad
Described by ovrLayerQuad. Previously called ovrLayerType_QuadInWorld.
ovrLayerType_EyeMatrix
Described by ovrLayerEyeMatrix.
ovrLayerType_EnumSize
Force type int32_t.
enum OVR_CAPI.h.ovrLayerFlags
Identifies flags used by ovrLayerHeader and which are passed to ovr_SubmitFrame.
Enumerator
ovrLayerFlag_HighQuality
ovrLayerFlag_HighQuality enables 4x anisotropic sampling during the composition of the layer.
ovrLayerFlag_TextureOriginAtBottomLeft
ovrLayerFlag_TextureOriginAtBottomLeft: the opposite is TopLeft.
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.

SDK Distortion Rendering Documentation

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. session Specifies an ovrSession previously returned by ovr_Create. chain Specifies the ovrTextureSwapChain for which the length should be retrieved. out_Length Returns the number of buffers in the specified chain. Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
ovrResult ovr_GetTextureSwapChainCurrentIndex ( ovrSession session, ovrTextureSwapChain chain, int * out_Index )
Gets the current index in an ovrTextureSwapChain.
session Specifies an ovrSession previously returned by ovr_Create. chain Specifies the ovrTextureSwapChain for which the index should be retrieved. out_Index Returns the current (free) index in specified chain. Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
ovrResult ovr_GetTextureSwapChainDesc ( ovrSession session, ovrTextureSwapChain chain, ovrTextureSwapChainDesc * out_Desc )
Gets the description of the buffers in an ovrTextureSwapChain.
session Specifies an ovrSession previously returned by ovr_Create. chain Specifies the ovrTextureSwapChain for which the description should be retrieved. out_Desc Returns the description of the specified chain. Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
ovrResult ovr_CommitTextureSwapChain ( ovrSession session, ovrTextureSwapChain chain )
Commits any pending changes to an ovrTextureSwapChain, and advances its current index.
session Specifies an ovrSession previously returned by ovr_Create. chain Specifies the ovrTextureSwapChain to commit. 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 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. ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
void ovr_DestroyTextureSwapChain ( ovrSession session, ovrTextureSwapChain chain )
Destroys an ovrTextureSwapChain and frees all the resources associated with it.
session Specifies an ovrSession previously returned by ovr_Create. chain Specifies the ovrTextureSwapChain to destroy. If it is NULL then this function has no effect. ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL
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. session Specifies an ovrSession previously returned by ovr_Create. mirrorTexture Specifies the ovrTexture to destroy. If it is NULL then this function has no effect. ovr_CreateMirrorTextureDX, ovr_CreateMirrorTextureGL
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. session Specifies an ovrSession previously returned by ovr_Create. eye Specifies which eye (left or right) to calculate for. fov Specifies the ovrFovPort to use. pixelsPerDisplayPixel Specifies 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 ovrHmdDeschmdDesc=ovr_GetHmdDesc(session); ovrSizeieyeSizeLeft=ovr_GetFovTextureSize(session,ovrEye_Left, hmdDesc.DefaultEyeFov[ovrEye_Left],1.0f); ovrSizeieyeSizeRight=ovr_GetFovTextureSize(session,ovrEye_Right, hmdDesc.DefaultEyeFov[ovrEye_Right],1.0f); Returns the texture width and height size.
ovrEyeRenderDesc ovr_GetRenderDesc ( ovrSession session, ovrEyeType eyeType, ovrFovPort fov )
Computes the distortion viewport, view adjust, and other rendering parameters for the specified eye.
session Specifies an ovrSession previously returned by ovr_Create. eyeType Specifies which eye (left or right) for which to perform calculations. fov Specifies the ovrFovPort to use. Returns the computed ovrEyeRenderDesc for the given eyeType and field of view. ovrEyeRenderDesc
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. session Specifies an ovrSession previously returned by ovr_Create. frameIndex Specifies the targeted application frame index, or 0 to refer to one frame after the last time ovr_SubmitFrame was called. viewScaleDesc Provides 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. layerPtrList Specifies 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 absence of the given layer. layerCount Indicates 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 ovrLayerEyeFovlayer0; ovrLayerQuadlayer1; ... ovrLayerHeader*layers[2]={&layer0.Header,&layer1.Header}; ovrResultresult=ovr_SubmitFrame(session,frameIndex,nullptr,layers,2); 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, call ovr_GetSessionStatus to detect visibility.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. ovr_GetPredictedDisplayTime, ovrViewScaleDesc, ovrLayerHeader, ovr_GetSessionStatus

Frame Timing Documentation

enum OVR_CAPI.h.@1
Maximum number of frames of performance stats provided back to the caller of ovr_GetPerfStats.
Enumerator
ovrMaxProvidedFrameStats= 5
enum OVR_CAPI.h.ovrPerfHudMode
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.
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_AswStats
Shows Async Spacewarp-specific info.
ovrPerfHud_VersionInfo
Shows SDK & HMD version Info.
ovrPerfHud_Count= 7
ovrPerfHud_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrLayerHudMode
Layer HUD enables the HMD user to see information about a layer.
Enumerator
ovrLayerHud_Off
Turns off the layer HUD.
ovrLayerHud_Info
Shows info about a specific layer.
ovrLayerHud_EnumSize= 0x7fffffff
ovrResult ovr_GetPerfStats ( ovrSession session, ovrPerfStats * outStats )
Retrieves performance stats for the VR app as well as the SDK compositor.
This function will return stats for the VR app that is currently visible in the HMD regardless of what VR app is actually calling this function.If the VR app is trying to make sure the stats returned belong to the same application, the caller can compare the VisibleProcessId with their own process ID. Normally this will be the case if the caller is only calling ovr_GetPerfStats when ovr_GetSessionStatus has IsVisible flag set to be true.If the VR app calling ovr_GetPerfStats is actually the one visible in the HMD, then new perf stats will only be populated after a new call to ovr_SubmitFrame. That means subsequent calls to ovr_GetPerfStats after the first one without calling ovr_SubmitFrame will receive a FrameStatsCount of zero.If the VR app is not visible, or was initially marked as ovrInit_Invisible, then each call to ovr_GetPerfStats will immediately fetch new perf stats from the compositor without a need for the ovr_SubmitFrame call.Even though invisible VR apps do not require ovr_SubmitFrame to be called to gather new perf stats, since stats are generated at the native refresh rate of the HMD (i.e. 90 Hz for CV1), calling it at a higher rate than that would be unnecessary. session Specifies an ovrSession previously returned by ovr_Create. outStats Contains the performance stats for the application and SDK compositor Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. ovrPerfStats, ovrPerfStatsPerCompositorFrame, ovr_ResetPerfStats
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. session Specifies an ovrSession previously returned by ovr_Create. Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. ovrPerfStats, ovrPerfStatsPerCompositorFrame, ovr_GetPerfStats
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. session Specifies an ovrSession previously returned by ovr_Create. frameIndex Identifies 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
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. ovrPoseStatef, ovrFrameTiming

Mixed reality capture support Documentation

ovrResult ovr_GetExternalCameras ( ovrSession session, ovrExternalCamera * cameras, unsigned int * inoutCameraCount )
Returns the number of camera properties of all cameras.
session Specifies an ovrSession previously returned by ovr_Create.
ovrResult ovr_SetExternalCameraProperties ( ovrSession session, const char * name, const ovrCameraIntrinsics *const intrinsics, const ovrCameraExtrinsics *const extrinsics )
Sets the camera intrinsics and/or extrinsics stored for the cameraName camera Names must be < 32 characters and null-terminated.
session Specifies an ovrSession previously returned by ovr_Create. name Specifies which camera to set the intrinsics or extrinsics for intrinsics Contains the intrinsic parameters to set, can be null extrinsics Contains the extrinsic parameters to set, can be null Returns ovrSuccess or an ovrError code

Property Access Documentation

ovrBool ovr_GetBool ( ovrSession session, const char * propertyName, ovrBool defaultVal )
Reads a boolean property.
session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid for only the call. defaultVal specifes the value to return if the property couldn't be read. Returns the property interpreted as a boolean value. Returns defaultVal if the property doesn't exist.
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. session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid only for the call. value 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.
int ovr_GetInt ( ovrSession session, const char * propertyName, int defaultVal )
Reads an integer property.
session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid only for the call. defaultVal Specifes the value to return if the property couldn't be read. Returns the property interpreted as an integer value. Returns defaultVal if the property doesn't exist.
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. session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid only for the call. value 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.
float ovr_GetFloat ( ovrSession session, const char * propertyName, float defaultVal )
Reads a float property.
session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid only for the call. defaultVal specifes the value to return if the property couldn't be read. Returns the property interpreted as an float value. Returns defaultVal if the property doesn't exist.
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. session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid only for the call. value 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.
unsigned int ovr_GetFloatArray ( ovrSession session, const char * propertyName, float values, unsigned int valuesCapacity )
Reads a float array property.
session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid only for the call. values An array of float to write to. valuesCapacity Specifies the maximum number of elements to write to the values array. Returns the number of elements read, or 0 if property doesn't exist or is empty.
ovrBool ovr_SetFloatArray ( ovrSession session, const char * propertyName, const float values, unsigned int valuesSize )
Writes or creates a float array property.
session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid only for the call. values An array of float to write from. valuesSize Specifies the number of elements 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.
const char* ovr_GetString ( ovrSession session, const char * propertyName, const char * defaultVal )
Reads a string property.
Strings are UTF8-encoded and null-terminated. session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid only for the call. defaultVal 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 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.
ovrBool ovr_SetString ( ovrSession session, const char * propertyName, const char * value )
Writes or creates a string property.
Strings are UTF8-encoded and null-terminated. session Specifies an ovrSession previously returned by ovr_Create. propertyName The name of the property, which needs to be valid only for the call. value 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.

Macros Documentation

#define OVR_OS_WIN32
#define OVR_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
Provided for backward compatibility with older versions of this library.
#define OVR_SA_UNUSED
#define OVR_SA_PASTE
#define OVR_SA_HELP
#define OVR_STATIC_ASSERT
#define OVR_UNUSED_STRUCT_PAD
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.
#define OVR_PTR_SIZE
Specifies the size of a pointer on the given platform.
#define OVR_ON32
#define OVR_ON64
#define ovrFalse
ovrBool value of false.
#define ovrTrue
ovrBool value of true.
#define VK_DEFINE_HANDLE
Fallback definitions for when the vulkan header isn't being included.
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE
#define OVR_HAPTICS_BUFFER_SAMPLES_MAX
Maximum number of samples in ovrHapticsBuffer.
#define OVR_EXTERNAL_CAMERA_NAME_SIZE

Enumeration Type Documentation

enum OVR_CAPI.h.ovrHmdType
Enumerates all HMD types that we support.
Enumerator
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
enum OVR_CAPI.h.ovrHmdCaps
HMD capability bits reported by device.
Enumerator
ovrHmdCap_DebugDevice
(read only) Specifies that the HMD is a virtual debug device.
ovrHmdCap_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrTrackingCaps
Tracking capability bits reported by the device.
Enumerator
ovrTrackingCap_Orientation
Supports orientation tracking (IMU).
ovrTrackingCap_MagYawCorrection
Supports yaw drift correction.
ovrTrackingCap_Position
Supports positional tracking.
ovrTrackingCap_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrEyeType
Specifies which eye is being used for rendering.
Enumerator
ovrEye_Left
The left eye, from the viewer's perspective.
ovrEye_Right
The right eye, from the viewer's perspective.
ovrEye_Count= 2
ovrEye_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrTrackingOrigin
Specifies the coordinate system ovrTrackingState returns tracking poses in.
Enumerator
ovrTrackingOrigin_EyeLevel
Tracking system origin reported at eye (HMD) height.
ovrTrackingOrigin_FloorLevel
Tracking system origin reported at floor height.
ovrTrackingOrigin_Count= 2
ovrTrackingOrigin_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrStatusBits
Bit flags describing the current status of sensor tracking.
Enumerator
ovrStatus_OrientationTracked
Orientation is currently tracked (connected & in use).
ovrStatus_PositionTracked
Position is currently tracked (false if out of range).
ovrStatus_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrTrackerFlags
Specifies sensor flags.
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.
enum OVR_CAPI.h.ovrTextureType
The type of texture resource.
Enumerator
ovrTexture_2D
2D textures.
ovrTexture_2D_External
Application-provided 2D texture. Not supported on PC.
ovrTexture_Cube
Cube maps. ovrTextureSwapChainDesc::ArraySize must be 6 for this type.
ovrTexture_Count
ovrTexture_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrTextureBindFlags
The bindings required for texture swap chain.
Enumerator
ovrTextureBind_None
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.
ovrTextureBind_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrTextureFormat
The format of a texture.
Enumerator
OVR_FORMAT_UNKNOWN= 0
OVR_FORMAT_B5G6R5_UNORM
Not currently supported on PC. Requires a DirectX 11.1 device.
OVR_FORMAT_B5G5R5A1_UNORM
Not currently supported on PC. Requires a DirectX 11.1 device.
OVR_FORMAT_B4G4R4A4_UNORM
Not currently supported on PC. Requires a DirectX 11.1 device.
OVR_FORMAT_R8G8B8A8_UNORM= 4
OVR_FORMAT_R8G8B8A8_UNORM_SRGB= 5
OVR_FORMAT_B8G8R8A8_UNORM= 6
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_R16G16B16A16_FLOAT= 10
OVR_FORMAT_R11G11B10_FLOAT
Introduced in v1.10.
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
enum OVR_CAPI.h.ovrTextureFlags
Misc flags overriding particular behaviors of a texture swap chain.
Enumerator
ovrTextureMisc_None
ovrTextureMisc_DX_Typeless
Vulkan and DX only: The underlying texture is created with a TYPELESS equivalent of the format specified in the texture desc.
ovrTextureMisc_AllowGenerateMips
DX only: Allow generation of the mip chain on the GPU via the GenerateMips call.
ovrTextureMisc_ProtectedContent
Texture swap chain contains protected content, and requires HDCP connection in order to display to HMD.
ovrTextureMisc_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrButton
Describes button input types.
Enumerator
ovrButton_A
A button on XBox controllers and right Touch controller. Select button on Oculus Remote.
ovrButton_B
B button on XBox controllers and right Touch controller. Back button on Oculus Remote.
ovrButton_RThumb
Right thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.
ovrButton_RShoulder
Right shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.
ovrButton_X
X button on XBox controllers and left Touch controller. Not present on Oculus Remote.
ovrButton_Y
Y button on XBox controllers and left Touch controller. Not present on Oculus Remote.
ovrButton_LThumb
Left thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.
ovrButton_LShoulder
Left shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.
ovrButton_Up
Up button on XBox controllers and Oculus Remote. Not present on Touch controllers.
ovrButton_Down
Down button on XBox controllers and Oculus Remote. Not present on Touch controllers.
ovrButton_Left
Left button on XBox controllers and Oculus Remote. Not present on Touch controllers.
ovrButton_Right
Right button on XBox controllers and Oculus Remote. Not present on Touch controllers.
ovrButton_Enter
Start on XBox 360 controller.
ovrButton_Back
Back on Xbox 360 controller.
ovrButton_VolUp
Volume button on Oculus Remote. Not present on XBox or Touch controllers.
ovrButton_VolDown
Volume button on Oculus Remote. Not present on XBox or Touch controllers.
ovrButton_Home
Home button on XBox controllers. Oculus button on Touch controllers and Oculus Remote.
ovrButton_Private= ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home
ovrButton_RMask= ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder
ovrButton_LMask= ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder | ovrButton_Enter
ovrButton_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrTouch
Describes touch input types.
Enumerator
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
enum OVR_CAPI.h.ovrControllerType
Specifies which controller is connected; multiple can be connected at once.
Enumerator
ovrControllerType_None= 0x0000
ovrControllerType_LTouch= 0x0001
ovrControllerType_RTouch= 0x0002
ovrControllerType_Touch= (ovrControllerType_LTouch | ovrControllerType_RTouch)
ovrControllerType_Remote= 0x0004
ovrControllerType_XBox= 0x0010
ovrControllerType_Object0= 0x0100
ovrControllerType_Object1= 0x0200
ovrControllerType_Object2= 0x0400
ovrControllerType_Object3= 0x0800
ovrControllerType_Active
Operate on or query whichever controller is active.
ovrControllerType_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrHapticsBufferSubmitMode
Haptics buffer submit mode.
Enumerator
ovrHapticsBufferSubmit_Enqueue
Enqueue buffer for later playback.
enum OVR_CAPI.h.ovrTrackedDeviceType
Position tracked devices.
Enumerator
ovrTrackedDevice_None= 0x0000
ovrTrackedDevice_HMD= 0x0001
ovrTrackedDevice_LTouch= 0x0002
ovrTrackedDevice_RTouch= 0x0004
ovrTrackedDevice_Touch= (ovrTrackedDevice_LTouch | ovrTrackedDevice_RTouch)
ovrTrackedDevice_Object0= 0x0010
ovrTrackedDevice_Object1= 0x0020
ovrTrackedDevice_Object2= 0x0040
ovrTrackedDevice_Object3= 0x0080
ovrTrackedDevice_All= 0xFFFF
enum OVR_CAPI.h.ovrBoundaryType
Boundary types that specified while using the boundary system.
Enumerator
ovrBoundary_Outer
Outer boundary - closely represents user setup walls.
ovrBoundary_PlayArea
Play area - safe rectangular area inside outer boundary which can optionally be used to restrict user interactions and motion.
enum OVR_CAPI.h.ovrHandType
Provides names for the left and right hand array indexes.
Enumerator
ovrHand_Left= 0
ovrHand_Right= 1
ovrHand_Count= 2
ovrHand_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrCameraStatusFlags
Enumerator
ovrCameraStatus_None
Initial state of camera.
ovrCameraStatus_Connected
Bit set when the camera is connected to the system.
ovrCameraStatus_Calibrating
Bit set when the camera is undergoing calibration.
ovrCameraStatus_CalibrationFailed
Bit set when the camera has tried & failed calibration.
ovrCameraStatus_Calibrated
Bit set when the camera has tried & passed calibration.
ovrCameraStatus_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrInitFlags
Initialization flags.
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.
ovrInit_Invisible
This client will not be visible in the HMD.
ovrInit_MixedRendering
This client will alternate between VR and 2D rendering.
ovrinit_WritableBits
These bits are writable by user code.
ovrInit_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrLogLevel
Logging levels.
Enumerator
ovrLogLevel_Debug
Debug-level log event.
ovrLogLevel_Info
Info-level log event.
ovrLogLevel_Error
Error-level log event.
ovrLogLevel_EnumSize= 0x7fffffff
enum OVR_CAPI.h.ovrDebugHudStereoMode
Debug HUD is provided to help developers gauge and debug the fidelity of their app's stereo rendering characteristics.
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.
ovrDebugHudStereo_Count
ovrDebugHudStereo_EnumSize= 0x7fffffff

Typedef Documentation

typedef char ovrBool ( )
Boolean type.
typedef struct ovrHmdStruct* ovrSession ( )
Used as an opaque pointer to an OVR session.
typedef uint32_t ovrProcessId ( )
typedef struct ovrTextureSwapChainData* ovrTextureSwapChain ( )
typedef struct ovrMirrorTextureData* ovrMirrorTexture ( )
typedef void(OVR_CDECL* ovrLogCallback) (uintptr_t userData, int level, const char *message) ( )
Signature of the logging callback function pointer type.
userData is an arbitrary value specified by the user of ovrInitParams. level is one of the ovrLogLevel constants. message is a UTF8-encoded null-terminated string. ovrInitParams, ovrLogLevel, ovr_Initialize

Function Documentation

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: 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 directoryDevelopment directory (only if OVR_ENABLE_DEVELOPER_SEARCH is enabled, which is off by default).Standard OS shared library search location(s) (OS-specific). params Specifies 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 in the LibOVRRT DLL then this must be valid and include ovrInit_RequestVersion. 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 ovrInitParamsinitParams={ovrInit_RequestVersion,OVR_MINOR_VERSION,NULL,0,0}; ovrResultresult=ovr_Initialize(&initParams); if(OVR_FAILURE(result)){ ovrErrorInfoerrorInfo; ovr_GetLastErrorInfo(&errorInfo); DebugLog("ovr_Initializefailed:%s",errorInfo.ErrorString); returnfalse; } [...] ovr_Shutdown
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.ovr_Initialize
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. errorInfo The last ovrErrorInfo for the current thread. ovrErrorInfo
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 a UTF8-encoded null-terminated version string.
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. level One of the ovrLogLevel constants. message A UTF8-encoded null-terminated string. returns the strlen of the message or a negative value if the message is too large. ovrLogLevel, ovrLogCallback
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. identity Specifies 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");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
60
61
62
63
64
65
66
67
68
69
70
71
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
228
229
230
231
232
233
234
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
272
273
275
276
278
279
282
283
284
285
286
288
289
291
292
294
295
297
298
301
302
303
304
305
311
312
313
314
315
316
317
318
319
320
326
327
328
329
330
331
332
333
334
335
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
358
359
360
362
363
364
365
366
367
370
371
372
373
374
375
376
380
381
382
383
384
385
386
389
401
402
411
412
413
414
415
416
419
420
421
422
423
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
447
448
449
450
451
452
453
454
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
478
479
480
481
482
483
488
489
490
491
492
493
494
499
501
502
505
506
507
510
512
513
516
517
521
522
523
524
525
531
533
534
536
537
541
542
545
546
554
555
556
557
558
559
567
568
569
570
571
572
573
574
582
583
584
585
586
587
588
601
602
603
604
605
606
607
608
613
614
615
616
617
618
619
620
628
629
630
632
633
635
636
639
640
641
642
643
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
688
689
690
695
696
699
700
704
705
706
707
708
714
715
716
717
718
719
720
721
722
723
724
725
726
727
736
737
738
739
740
741
742
743
744
745
746
747
748
754
756
757
759
760
762
763
765
766
767
769
770
772
773
775
776
778
779
781
782
784
785
787
788
790
791
794
795
798
799
801
802
804
805
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
902
904
905
906
908
909
911
913
915
917
918
919
921
922
923
924
925
926
927
928
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
946
948
949
952
953
954
956
958
959
960
962
965
966
968
969
971
972
974
975
976
981
982
983
984
985
986
987
991
993
994
996
997
999
1000
1006
1007
1012
1013
1018
1019
1021
1022
1028
1029
1035
1036
1040
1041
1047
1048
1054
1055
1059
1060
1061
1062
1064
1065
1067
1068
1070
1071
1073
1074
1076
1077
1079
1080
1082
1083
1085
1086
1087
1088
1089
1091
1092
1094
1095
1097
1098
1100
1101
1103
1104
1105
1106
1107
1110
1111
1113
1114
1119
1120
1123
1124
1126
1127
1129
1130
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1151
1154
1155
1156
1162
1163
1164
1167
1168
1171
1172
1173
1174
1175
1176
1177
1179
1180
1181
1182
1183
1188
1189
1190
1191
1192
1193
1194
1195
1203
1204
1209
1212
1213
1218
1219
1223
1224
1228
1229
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1296
1297
1309
1310
1326
1327
1341
1342
1354
1355
1382
1383
1384
1389
1401
1402
1412
1413
1430
1431
1432
1461
1462
1468
1469
1470
1471
1476
1478
1479
1481
1482
1484
1485
1487
1488
1490
1491
1494
1495
1496
1497
1498
1499
1500
1513
1514
1515
1517
1518
1527
1528
1541
1542
1543
1552
1553
1583
1584
1629
1630
1637
1638
1657
1658
1659
1674
1675
1676
1677
1678
1679
1680
1681
1682
1693
1694
1695
1704
1705
1706
1713
1714
1722
1723
1724
1742
1743
1744
1745
1746
1747
1748
1764
1765
1766
1767
1768
1769
1783
1784
1785
1786
1787
1788
1809
1810
1811
1812
1813
1814
1815
1832
1833
1834
1835
1836
1837
1838
1846
1847
1848
1855
1856
1870
1871
1872
1873
1874
1875
1876
1889
1890
1891
1892
1893
1894
1908
1909
1917
1918
1920
1921
1922
1923
1924
1925
1927
1932
1933
1939
1941
1942
1944
1945
1946
1948
1949
1950
1951
1952
1954
1955
1956
1957
1958
1959
1960
1965
1971
1972
1975
1976
1982
1983
1984
1985
1993
1994
1995
1996
1997
2013
2015
2016
2019
2020
2023
2024
2026
2027
2031
2032
2037
2038
2039
2040
2041
2060
2062
2063
2066
2067
2070
2071
2075
2076
2082
2083
2088
2089
2090
2091
2105
2107
2108
2110
2111
2113
2114
2120
2121
2123
2124
2125
2126
2127
2128
2131
2132
2133
2134
2135
2136
2138
2139
2140
2150
2151
2155
2166
2167
2168
2179
2180
2181
2193
2194
2195
2196
2197
2198
2217
2218
2219
2228
2229
2230
2234
2243
2244
2245
2272
2273
2274
2275
2276
2277
2278
2290
2291
2292
2293
2358
2359
2360
2361
2362
2363
2364
2366
2367
2368
2369
2372
2373
2379
2383
2384
2388
2390
2391
2394
2395
2400
2401
2406
2407
2411
2412
2415
2416
2420
2424
2425
2430
2431
2435
2436
2440
2441
2444
2445
2449
2450
2453
2454
2458
2461
2462
2465
2466
2469
2470
2473
2474
2475
2476
2480
2481
2486
2498
2499
2500
2503
2504
2517
2518
2521
2522
2526
2527
2528
2529
2530
2561
2562
2575
2576
2599
2600
2609
2610
2611
2612
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2643
2644
2645
2646
2647
2648
2650
2666
2668
2669
2671
2672
2674
2675
2677
2678
2680
2681
2682
2683
2684
2685
2686
2687
2688
2693
2694
2703
2704
2705
2706
2707
2708
2717
2718
2719
2720
2721
2722
2723
2725
2726
2727
2728
2729
2730
2736
2737
2745
2746
2747
2757
2758
2759
2767
2768
2778
2779
2787
2788
2789
2798
2799
2800
2808
2809
2810
2811
2812
2813
2814
2823
2824
2825
2826
2827
2828
2829
2839
2840
2841
2850
2851
2852
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2879
2880
/************************************************************************************
 \file      OVR_CAPI.h
 \brief     C Interface to the Oculus PC SDK tracking and rendering library.
 \copyright Copyright 2014 Oculus VR, LLC All Rights reserved.
 ************************************************************************************/

// We don't use version numbers within OVR_CAPI_h, as all versioned variations
// of this file are currently mutually exclusive.
#ifndef OVR_CAPI_h
#define OVR_CAPI_h

#include "OVR_CAPI_Keys.h"
#include "OVR_Version.h"
#include "OVR_ErrorCode.h"

#if !defined(_WIN32)
#include <sys/types.h>
#endif


#include <stdint.h>

#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4324) // structure was padded due to __declspec(align())
#pragma warning(disable : 4359) // The alignment specified for a type is less than the
// alignment of the type of one of its data members
#endif

//-----------------------------------------------------------------------------------
// ***** OVR_OS
//
#if !defined(OVR_OS_WIN32) && defined(_WIN32)
#define OVR_OS_WIN32
#endif

#if !defined(OVR_OS_MAC) && defined(__APPLE__)
#define OVR_OS_MAC
#endif

#if !defined(OVR_OS_LINUX) && defined(__linux__)
#define OVR_OS_LINUX
#endif

//-----------------------------------------------------------------------------------
// ***** OVR_CPP
//
#if !defined(OVR_CPP)
#if defined(__cplusplus)
#define OVR_CPP(x) x
#else
#define OVR_CPP(x) /* Not C++ */
#endif
#endif

//-----------------------------------------------------------------------------------
// ***** OVR_CDECL
//
//
#if !defined(OVR_CDECL)
#if defined(_WIN32)
#define OVR_CDECL __cdecl
#else
#define OVR_CDECL
#endif
#endif

//-----------------------------------------------------------------------------------
// ***** OVR_EXTERN_C
//
//
#if !defined(OVR_EXTERN_C)
#ifdef __cplusplus
#define OVR_EXTERN_C extern "C"
#else
#define OVR_EXTERN_C
#endif
#endif

//-----------------------------------------------------------------------------------
// ***** OVR_PUBLIC_FUNCTION / OVR_PRIVATE_FUNCTION
//
// OVR_PUBLIC_FUNCTION  - Functions that externally visible from a shared library.
//                        Corresponds to Microsoft __dllexport.
// OVR_PUBLIC_CLASS     - C++ structs and classes that are externally visible from a
//                        shared library. Corresponds to Microsoft __dllexport.
// OVR_PRIVATE_FUNCTION - Functions that are not visible outside of a shared library.
//                        They are private to the shared library.
// OVR_PRIVATE_CLASS    - C++ structs and classes that are not visible outside of a
//                        shared library. They are private to the shared library.
//
// OVR_DLL_BUILD        - Used to indicate that the current compilation unit is of a shared library.
// OVR_DLL_IMPORT       - Used to indicate that the current compilation unit is a
//                        user of the corresponding shared library.
// OVR_STATIC_BUILD     - used to indicate that the current compilation unit is not a
//                        shared library but rather statically linked code.
//
#if !defined(OVR_PUBLIC_FUNCTION)
#if defined(OVR_DLL_BUILD)
#if defined(_WIN32)
#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C __declspec(dllexport) rval OVR_CDECL
#define OVR_PUBLIC_CLASS __declspec(dllexport)
#define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL
#define OVR_PRIVATE_CLASS
#else
#define OVR_PUBLIC_FUNCTION(rval) \
  OVR_EXTERN_C __attribute__((visibility("default"))) rval OVR_CDECL /* Requires GCC 4.0+ */
#define OVR_PUBLIC_CLASS __attribute__((visibility("default"))) /* Requires GCC 4.0+ */
#define OVR_PRIVATE_FUNCTION(rval) __attribute__((visibility("hidden"))) rval OVR_CDECL
#define OVR_PRIVATE_CLASS __attribute__((visibility("hidden")))
#endif
#elif defined(OVR_DLL_IMPORT)
#if defined(_WIN32)
#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C __declspec(dllimport) rval OVR_CDECL
#define OVR_PUBLIC_CLASS __declspec(dllimport)
#else
#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C rval OVR_CDECL
#define OVR_PUBLIC_CLASS
#endif
#define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL
#define OVR_PRIVATE_CLASS
#else // OVR_STATIC_BUILD
#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C rval OVR_CDECL
#define OVR_PUBLIC_CLASS
#define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL
#define OVR_PRIVATE_CLASS
#endif
#endif

//-----------------------------------------------------------------------------------
// ***** OVR_EXPORT
//
//
#if !defined(OVR_EXPORT)
#ifdef OVR_OS_WIN32
#define OVR_EXPORT __declspec(dllexport)
#else
#define OVR_EXPORT
#endif
#endif

//-----------------------------------------------------------------------------------
// ***** OVR_ALIGNAS
//
#if !defined(OVR_ALIGNAS)
#if defined(__GNUC__) || defined(__clang__)
#define OVR_ALIGNAS(n) __attribute__((aligned(n)))
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
#define OVR_ALIGNAS(n) __declspec(align(n))
#elif defined(__CC_ARM)
#define OVR_ALIGNAS(n) __align(n)
#else
#error Need to define OVR_ALIGNAS
#endif
#endif

//-----------------------------------------------------------------------------------
// ***** OVR_CC_HAS_FEATURE
//
// This is a portable way to use compile-time feature identification available
// with some compilers in a clean way. Direct usage of __has_feature in preprocessing
// statements of non-supporting compilers results in a preprocessing error.
//
// Example usage:
//     #if OVR_CC_HAS_FEATURE(is_pod)
//         if(__is_pod(T)) // If the type is plain data then we can safely memcpy it.
//             memcpy(&destObject, &srcObject, sizeof(object));
//     #endif
//
#if !defined(OVR_CC_HAS_FEATURE)
#if defined(__clang__) // http://clang.llvm.org/docs/LanguageExtensions.html#id2
#define OVR_CC_HAS_FEATURE(x) __has_feature(x)
#else
#define OVR_CC_HAS_FEATURE(x) 0
#endif
#endif

// ------------------------------------------------------------------------
// ***** OVR_STATIC_ASSERT
//
// Portable support for C++11 static_assert().
// Acts as if the following were declared:
//     void OVR_STATIC_ASSERT(bool const_expression, const char* msg);
//
// Example usage:
//     OVR_STATIC_ASSERT(sizeof(int32_t) == 4, "int32_t expected to be 4 bytes.");

#if !defined(OVR_STATIC_ASSERT)
#if !(defined(__cplusplus) && (__cplusplus >= 201103L)) /* Other */ && \
    !(defined(__GXX_EXPERIMENTAL_CXX0X__)) /* GCC */ &&                \
    !(defined(__clang__) && defined(__cplusplus) &&                    \
      OVR_CC_HAS_FEATURE(cxx_static_assert)) /* clang */               \
    && !(defined(_MSC_VER) && (_MSC_VER >= 1600) && defined(__cplusplus)) /* VS2010+  */

#if !defined(OVR_SA_UNUSED)
#if defined(OVR_CC_GNU) || defined(OVR_CC_CLANG)
#define OVR_SA_UNUSED __attribute__((unused))
#else
#define OVR_SA_UNUSED
#endif
#define OVR_SA_PASTE(a, b) a##b
#define OVR_SA_HELP(a, b) OVR_SA_PASTE(a, b)
#endif

#if defined(__COUNTER__)
#define OVR_STATIC_ASSERT(expression, msg) \
  typedef char OVR_SA_HELP(staticAssert, __COUNTER__)[((expression) != 0) ? 1 : -1] OVR_SA_UNUSED
#else
#define OVR_STATIC_ASSERT(expression, msg) \
  typedef char OVR_SA_HELP(staticAssert, __LINE__)[((expression) != 0) ? 1 : -1] OVR_SA_UNUSED
#endif

#else
#define OVR_STATIC_ASSERT(expression, msg) static_assert(expression, msg)
#endif
#endif

//-----------------------------------------------------------------------------------
// ***** Padding
//
#if !defined(OVR_UNUSED_STRUCT_PAD)
#define OVR_UNUSED_STRUCT_PAD(padName, size) char padName[size];
#endif

//-----------------------------------------------------------------------------------
// ***** Word Size
//
#if !defined(OVR_PTR_SIZE)
#if defined(__WORDSIZE)
#define OVR_PTR_SIZE ((__WORDSIZE) / 8)
#elif defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(_M_IA64) || \
    defined(__ia64__) || defined(__arch64__) || defined(__64BIT__) || defined(__Ptr_Is_64)
#define OVR_PTR_SIZE 8
#elif defined(__CC_ARM) && (__sizeof_ptr == 8)
#define OVR_PTR_SIZE 8
#else
#define OVR_PTR_SIZE 4
#endif
#endif

//-----------------------------------------------------------------------------------
// ***** OVR_ON32 / OVR_ON64
//
#if OVR_PTR_SIZE == 8
#define OVR_ON32(x)
#define OVR_ON64(x) x
#else
#define OVR_ON32(x) x
#define OVR_ON64(x)
#endif

//-----------------------------------------------------------------------------------
// ***** ovrBool

typedefchar ovrBool; 
#define ovrFalse 0 
#define ovrTrue 1 

//-----------------------------------------------------------------------------------
// ***** Simple Math Structures

typedefstruct OVR_ALIGNAS(4) ovrColorf_ { float r, g, b, a; } ovrColorf;

typedefstruct OVR_ALIGNAS(4) ovrVector2i_ { int x, y; } ovrVector2i;

typedefstruct OVR_ALIGNAS(4) ovrSizei_ { int w, h; } ovrSizei;

typedefstruct OVR_ALIGNAS(4) ovrRecti_ {
  ovrVector2i Pos;
  ovrSizei Size;
} ovrRecti;

typedefstruct OVR_ALIGNAS(4) ovrQuatf_ { float x, y, z, w; } ovrQuatf;

typedefstruct OVR_ALIGNAS(4) ovrVector2f_ { float x, y; } ovrVector2f;

typedefstruct OVR_ALIGNAS(4) ovrVector3f_ { float x, y, z; } ovrVector3f;

typedefstruct OVR_ALIGNAS(4) ovrMatrix4f_ { float M[4][4]; } ovrMatrix4f;

typedefstruct OVR_ALIGNAS(4) ovrPosef_ {
  ovrQuatf Orientation;
  ovrVector3f Position;
} ovrPosef;

typedefstruct OVR_ALIGNAS(8) ovrPoseStatef_ {
  ovrPosef ThePose; 
  ovrVector3f AngularVelocity; 
  ovrVector3f LinearVelocity; 
  ovrVector3f AngularAcceleration; 
  ovrVector3f LinearAcceleration; 
  OVR_UNUSED_STRUCT_PAD(pad0, 4) 
  double TimeInSeconds; 
} ovrPoseStatef;

typedef struct OVR_ALIGNAS(4) ovrFovPort_ {
float UpTan; 
float DownTan; 
float LeftTan; 
float RightTan; 
} ovrFovPort;

//-----------------------------------------------------------------------------------
// ***** HMD Types

typedefenum 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 
} ovrHmdType;

typedefenum ovrHmdCaps_ {
// Read-only flags

  ovrHmdCap_DebugDevice = 0x0010,


  ovrHmdCap_EnumSize = 0x7fffffff 
} ovrHmdCaps;

typedefenum ovrTrackingCaps_ {
  ovrTrackingCap_Orientation = 0x0010, 
  ovrTrackingCap_MagYawCorrection = 0x0020, 
  ovrTrackingCap_Position = 0x0040, 
  ovrTrackingCap_EnumSize = 0x7fffffff 
} ovrTrackingCaps;

typedefenum ovrEyeType_ {
  ovrEye_Left = 0, 
  ovrEye_Right = 1, 
  ovrEye_Count = 2, 
  ovrEye_EnumSize = 0x7fffffff 
} ovrEyeType;

typedefenum ovrTrackingOrigin_ {
  ovrTrackingOrigin_EyeLevel = 0,

  ovrTrackingOrigin_FloorLevel = 1,

  ovrTrackingOrigin_Count = 2, 
  ovrTrackingOrigin_EnumSize = 0x7fffffff 
} ovrTrackingOrigin;

typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrGraphicsLuid_ {
// Public definition reserves space for graphics API-specific implementation
char Reserved[8];
} ovrGraphicsLuid;

typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrHmdDesc_ {
  ovrHmdType Type; 
  OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad0, 4)) 
  char ProductName[64]; 
char Manufacturer[64]; 
short VendorId; 
short ProductId; 
char SerialNumber[24]; 
short FirmwareMajor; 
short FirmwareMinor; 
unsignedint AvailableHmdCaps; 
unsignedint DefaultHmdCaps; 
unsignedint AvailableTrackingCaps; 
unsignedint DefaultTrackingCaps; 
  ovrFovPort DefaultEyeFov[ovrEye_Count]; 
  ovrFovPort MaxEyeFov[ovrEye_Count]; 
  ovrSizei Resolution; 
float DisplayRefreshRate; 
  OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad1, 4)) 
} ovrHmdDesc;

typedef struct ovrHmdStruct* ovrSession;

#ifdef OVR_OS_WIN32
typedef uint32_t ovrProcessId;
#else
typedef pid_t ovrProcessId;
#endif

#if !defined(VK_VERSION_1_0)
// From <vulkan/vulkan.h>:
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || \
    defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) ||       \
    defined(__powerpc64__)
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T* object;
#else
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
#endif
VK_DEFINE_HANDLE(VkInstance)
VK_DEFINE_HANDLE(VkPhysicalDevice)
VK_DEFINE_HANDLE(VkDevice)
VK_DEFINE_HANDLE(VkQueue)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage)
#endif

typedefenum ovrStatusBits_ {
  ovrStatus_OrientationTracked = 0x0001, 
  ovrStatus_PositionTracked = 0x0002, 
  ovrStatus_EnumSize = 0x7fffffff 
} ovrStatusBits;

typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTrackerDesc_ {
float FrustumHFovInRadians; 
float FrustumVFovInRadians; 
float FrustumNearZInMeters; 
float FrustumFarZInMeters; 
} ovrTrackerDesc;

typedefenum ovrTrackerFlags_ {
  ovrTracker_Connected = 0x0020,

  ovrTracker_PoseTracked = 0x0004
} ovrTrackerFlags;

typedefstruct OVR_ALIGNAS(8) _ovrTrackerPose {
unsignedint TrackerFlags;

  ovrPosef Pose;

  ovrPosef LeveledPose;

  OVR_UNUSED_STRUCT_PAD(pad0, 4) 
} ovrTrackerPose;

typedefstruct OVR_ALIGNAS(8) ovrTrackingState_ {
  ovrPoseStatef HeadPose;

unsignedint StatusFlags;

  ovrPoseStatef HandPoses[2];

unsignedint HandStatusFlags[2];

  ovrPosef CalibratedOrigin;

} ovrTrackingState;



typedefstruct OVR_ALIGNAS(4) ovrEyeRenderDesc_ {
  ovrEyeType Eye; 
  ovrFovPort Fov; 
  ovrRecti DistortedViewport; 
  ovrVector2f PixelsPerTanAngleAtCenter; 
  ovrPosef HmdToEyePose; 
} ovrEyeRenderDesc;

typedefstruct OVR_ALIGNAS(4) ovrTimewarpProjectionDesc_ {
float Projection22; 
float Projection23; 
float Projection32; 
} ovrTimewarpProjectionDesc;


typedefstruct OVR_ALIGNAS(4) ovrViewScaleDesc_ {
  ovrPosef HmdToEyePose[ovrEye_Count]; 
float HmdSpaceToWorldScaleInMeters; 
} ovrViewScaleDesc;

//-----------------------------------------------------------------------------------
// ***** Platform-independent Rendering Configuration

typedefenum ovrTextureType_ {
  ovrTexture_2D, 
  ovrTexture_2D_External, 
  ovrTexture_Cube, 
  ovrTexture_Count,
  ovrTexture_EnumSize = 0x7fffffff 
} ovrTextureType;

typedefenum ovrTextureBindFlags_ {
  ovrTextureBind_None,

  ovrTextureBind_DX_RenderTarget = 0x0001,

  ovrTextureBind_DX_UnorderedAccess = 0x0002,

  ovrTextureBind_DX_DepthStencil = 0x0004,

  ovrTextureBind_EnumSize = 0x7fffffff 
} ovrTextureBindFlags;

typedefenum 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, 

// Depth formats
  OVR_FORMAT_D16_UNORM = 11,
  OVR_FORMAT_D24_UNORM_S8_UINT = 12,
  OVR_FORMAT_D32_FLOAT = 13,
  OVR_FORMAT_D32_FLOAT_S8X24_UINT = 14,

// Added in 1.5 compressed formats can be used for static layers
  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 
} ovrTextureFormat;

typedefenum ovrTextureMiscFlags_ {
  ovrTextureMisc_None,

  ovrTextureMisc_DX_Typeless = 0x0001,

  ovrTextureMisc_AllowGenerateMips = 0x0002,

  ovrTextureMisc_ProtectedContent = 0x0004,

  ovrTextureMisc_EnumSize = 0x7fffffff 
} ovrTextureFlags;

typedefstruct ovrTextureSwapChainDesc_ {
  ovrTextureType Type;
  ovrTextureFormat Format;
int ArraySize; 
int Width;
int Height;
int MipLevels;
int SampleCount; 
  ovrBool StaticImage; 
unsignedint MiscFlags; 
unsignedint BindFlags; 
} ovrTextureSwapChainDesc;


typedefstruct ovrMirrorTextureDesc_ {
  ovrTextureFormat Format;
int Width;
int Height;
unsignedint MiscFlags; 
unsignedint MirrorOptions; 
} ovrMirrorTextureDesc;

typedefstruct ovrTextureSwapChainData* ovrTextureSwapChain;
typedefstruct ovrMirrorTextureData* ovrMirrorTexture;

//-----------------------------------------------------------------------------------

typedefenum 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,

// Bit mask of all buttons that are for private usage by Oculus
  ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home,

// Bit mask of all buttons on the right Touch controller
  ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder,

// Bit mask of all buttons on the left Touch controller
  ovrButton_LMask =
      ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder | ovrButton_Enter,

  ovrButton_EnumSize = 0x7fffffff 
} ovrButton;

typedefenum ovrTouch_ {
  ovrTouch_A = ovrButton_A,
  ovrTouch_B = ovrButton_B,
  ovrTouch_RThumb = ovrButton_RThumb,
  ovrTouch_RThumbRest = 0x00000008,
  ovrTouch_RIndexTrigger = 0x00000010,

// Bit mask of all the button touches on the right controller
  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,

// Bit mask of all the button touches on the left controller
  ovrTouch_LButtonMask =
      ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger,

// Finger pose state
// Derived internally based on distance, proximity to sensors and filtering.
  ovrTouch_RIndexPointing = 0x00000020,
  ovrTouch_RThumbUp = 0x00000040,
  ovrTouch_LIndexPointing = 0x00002000,
  ovrTouch_LThumbUp = 0x00004000,

// Bit mask of all right controller poses
  ovrTouch_RPoseMask = ovrTouch_RIndexPointing | ovrTouch_RThumbUp,

// Bit mask of all left controller poses
  ovrTouch_LPoseMask = ovrTouch_LIndexPointing | ovrTouch_LThumbUp,

  ovrTouch_EnumSize = 0x7fffffff 
} ovrTouch;

typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTouchHapticsDesc_ {
// Haptics engine frequency/sample-rate, sample time in seconds equals 1.0/sampleRateHz
int SampleRateHz;
// Size of each Haptics sample, sample value range is [0, 2^(Bytes*8)-1]
int SampleSizeInBytes;

// Queue size that would guarantee Haptics engine would not starve for data
// Make sure size doesn't drop below it for best results
int QueueMinSizeToAvoidStarvation;

// Minimum, Maximum and Optimal number of samples that can be sent to Haptics through
// ovr_SubmitControllerVibration
int SubmitMinSamples;
int SubmitMaxSamples;
int SubmitOptimalSamples;
} ovrTouchHapticsDesc;

typedefenum ovrControllerType_ {
  ovrControllerType_None = 0x0000,
  ovrControllerType_LTouch = 0x0001,
  ovrControllerType_RTouch = 0x0002,
  ovrControllerType_Touch = (ovrControllerType_LTouch | ovrControllerType_RTouch),
  ovrControllerType_Remote = 0x0004,

  ovrControllerType_XBox = 0x0010,

  ovrControllerType_Object0 = 0x0100,
  ovrControllerType_Object1 = 0x0200,
  ovrControllerType_Object2 = 0x0400,
  ovrControllerType_Object3 = 0x0800,

  ovrControllerType_Active = 0xffffffff, 

  ovrControllerType_EnumSize = 0x7fffffff 
} ovrControllerType;

typedefenum ovrHapticsBufferSubmitMode_ {
  ovrHapticsBufferSubmit_Enqueue
} ovrHapticsBufferSubmitMode;

#define OVR_HAPTICS_BUFFER_SAMPLES_MAX 256

typedefstruct ovrHapticsBuffer_ {
constvoid* Samples;
int SamplesCount;
  ovrHapticsBufferSubmitMode SubmitMode;
} ovrHapticsBuffer;

typedefstruct ovrHapticsPlaybackState_ {
// Remaining space available to queue more samples
int RemainingQueueSpace;

// Number of samples currently queued
int SamplesQueued;
} ovrHapticsPlaybackState;

typedefenum ovrTrackedDeviceType_ {
  ovrTrackedDevice_None = 0x0000,
  ovrTrackedDevice_HMD = 0x0001,
  ovrTrackedDevice_LTouch = 0x0002,
  ovrTrackedDevice_RTouch = 0x0004,
  ovrTrackedDevice_Touch = (ovrTrackedDevice_LTouch | ovrTrackedDevice_RTouch),

  ovrTrackedDevice_Object0 = 0x0010,
  ovrTrackedDevice_Object1 = 0x0020,
  ovrTrackedDevice_Object2 = 0x0040,
  ovrTrackedDevice_Object3 = 0x0080,

  ovrTrackedDevice_All = 0xFFFF,
} ovrTrackedDeviceType;

typedefenum ovrBoundaryType_ {
  ovrBoundary_Outer = 0x0001,

  ovrBoundary_PlayArea = 0x0100,
} ovrBoundaryType;

typedefstruct ovrBoundaryLookAndFeel_ {
  ovrColorf Color;
} ovrBoundaryLookAndFeel;

typedefstruct ovrBoundaryTestResult_ {
  ovrBool IsTriggering;

float ClosestDistance;

  ovrVector3f ClosestPoint;

  ovrVector3f ClosestPointNormal;
} ovrBoundaryTestResult;

typedefenum ovrHandType_ {
  ovrHand_Left = 0,
  ovrHand_Right = 1,
  ovrHand_Count = 2,
  ovrHand_EnumSize = 0x7fffffff 
} ovrHandType;

typedefstruct ovrInputState_ {
double TimeInSeconds;

unsignedint Buttons;

unsignedint Touches;

float IndexTrigger[ovrHand_Count];

float HandTrigger[ovrHand_Count];

  ovrVector2f Thumbstick[ovrHand_Count];

  ovrControllerType ControllerType;

float IndexTriggerNoDeadzone[ovrHand_Count];

float HandTriggerNoDeadzone[ovrHand_Count];

  ovrVector2f ThumbstickNoDeadzone[ovrHand_Count];

float IndexTriggerRaw[ovrHand_Count];

float HandTriggerRaw[ovrHand_Count];

  ovrVector2f ThumbstickRaw[ovrHand_Count];
} ovrInputState;

typedefstruct ovrCameraIntrinsics_ {
double LastChangedTime;

  ovrFovPort FOVPort;

float VirtualNearPlaneDistanceMeters;

float VirtualFarPlaneDistanceMeters;

  ovrSizei ImageSensorPixelResolution;

  ovrMatrix4f LensDistortionMatrix;

double ExposurePeriodSeconds;

double ExposureDurationSeconds;

} ovrCameraIntrinsics;

typedefenum ovrCameraStatusFlags_ {
  ovrCameraStatus_None = 0x0,

  ovrCameraStatus_Connected = 0x1,

  ovrCameraStatus_Calibrating = 0x2,

  ovrCameraStatus_CalibrationFailed = 0x4,

  ovrCameraStatus_Calibrated = 0x8,
  ovrCameraStatus_EnumSize = 0x7fffffff 
} ovrCameraStatusFlags;

typedefstruct ovrCameraExtrinsics_ {
double LastChangedTimeSeconds;

unsignedint CameraStatusFlags;

  ovrTrackedDeviceType AttachedToDevice;

  ovrPosef RelativePose;

double LastExposureTimeSeconds;

double ExposureLatencySeconds;

double AdditionalLatencySeconds;

} ovrCameraExtrinsics;

#define OVR_EXTERNAL_CAMERA_NAME_SIZE 32
typedefstruct ovrExternalCamera_ {
char Name[OVR_EXTERNAL_CAMERA_NAME_SIZE];
  ovrCameraIntrinsics Intrinsics;
  ovrCameraExtrinsics Extrinsics;
} ovrExternalCamera;

//-----------------------------------------------------------------------------------
// ***** Initialize structures

typedefenum ovrInitFlags_ {
  ovrInit_Debug = 0x00000001,


  ovrInit_RequestVersion = 0x00000004,


  ovrInit_Invisible = 0x00000010,

  ovrInit_MixedRendering = 0x00000020,






  ovrinit_WritableBits = 0x00ffffff,

  ovrInit_EnumSize = 0x7fffffff 
} ovrInitFlags;

typedefenum ovrLogLevel_ {
  ovrLogLevel_Debug = 0, 
  ovrLogLevel_Info = 1, 
  ovrLogLevel_Error = 2, 

  ovrLogLevel_EnumSize = 0x7fffffff 
} ovrLogLevel;

typedef void(OVR_CDECL* ovrLogCallback)(uintptr_t userData, int level, constchar* message);

typedefstruct OVR_ALIGNAS(8) ovrInitParams_ {
  uint32_t Flags;

  uint32_t RequestedMinorVersion;

  ovrLogCallback LogCallback;

  uintptr_t UserData;

  uint32_t ConnectionTimeoutMS;

  OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad0, 4)) 

} ovrInitParams;

#ifdef __cplusplus
extern"C" {
#endif

#if !defined(OVR_EXPORTING_CAPI)

// -----------------------------------------------------------------------------------
// ***** API Interfaces

OVR_PUBLIC_FUNCTION(ovrResult) ovr_Initialize(const ovrInitParams* params);

OVR_PUBLIC_FUNCTION(void) ovr_Shutdown();

OVR_PUBLIC_FUNCTION(void) ovr_GetLastErrorInfo(ovrErrorInfo* errorInfo);

OVR_PUBLIC_FUNCTION(constchar*) ovr_GetVersionString();

OVR_PUBLIC_FUNCTION(int) ovr_TraceMessage(int level, constchar* message);

OVR_PUBLIC_FUNCTION(ovrResult) ovr_IdentifyClient(constchar* identity);

//-------------------------------------------------------------------------------------

OVR_PUBLIC_FUNCTION(ovrHmdDesc) ovr_GetHmdDesc(ovrSession session);

OVR_PUBLIC_FUNCTION(unsignedint) ovr_GetTrackerCount(ovrSession session);

OVR_PUBLIC_FUNCTION(ovrTrackerDesc)
ovr_GetTrackerDesc(ovrSession session, unsignedint trackerDescIndex);

OVR_PUBLIC_FUNCTION(ovrResult) ovr_Create(ovrSession* pSession, ovrGraphicsLuid* pLuid);

OVR_PUBLIC_FUNCTION(void) ovr_Destroy(ovrSession session);

#endif // !defined(OVR_EXPORTING_CAPI)

typedefstruct ovrSessionStatus_ {
  ovrBool IsVisible;

  ovrBool HmdPresent;

  ovrBool HmdMounted;

  ovrBool DisplayLost;

  ovrBool ShouldQuit;

  ovrBool ShouldRecenter;

  ovrBool Internal[2];
} ovrSessionStatus;

#if !defined(OVR_EXPORTING_CAPI)

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetSessionStatus(ovrSession session, ovrSessionStatus* sessionStatus);


//-------------------------------------------------------------------------------------


OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SetTrackingOriginType(ovrSession session, ovrTrackingOrigin origin);

OVR_PUBLIC_FUNCTION(ovrTrackingOrigin) ovr_GetTrackingOriginType(ovrSession session);

OVR_PUBLIC_FUNCTION(ovrResult) ovr_RecenterTrackingOrigin(ovrSession session);

OVR_PUBLIC_FUNCTION(ovrResult) ovr_SpecifyTrackingOrigin(ovrSession session, ovrPosef originPose);

OVR_PUBLIC_FUNCTION(void) ovr_ClearShouldRecenterFlag(ovrSession session);

OVR_PUBLIC_FUNCTION(ovrTrackingState)
ovr_GetTrackingState(ovrSession session, double absTime, ovrBool latencyMarker);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetDevicePoses(
    ovrSession session,
    ovrTrackedDeviceType* deviceTypes,
int deviceCount,
double absTime,
    ovrPoseStatef* outDevicePoses);


OVR_PUBLIC_FUNCTION(ovrTrackerPose)
ovr_GetTrackerPose(ovrSession session, unsignedint trackerPoseIndex);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetInputState(ovrSession session, ovrControllerType controllerType, ovrInputState* inputState);

OVR_PUBLIC_FUNCTION(unsignedint) ovr_GetConnectedControllerTypes(ovrSession session);

OVR_PUBLIC_FUNCTION(ovrTouchHapticsDesc)
ovr_GetTouchHapticsDesc(ovrSession session, ovrControllerType controllerType);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SetControllerVibration(
    ovrSession session,
    ovrControllerType controllerType,
float frequency,
float amplitude);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SubmitControllerVibration(
    ovrSession session,
    ovrControllerType controllerType,
const ovrHapticsBuffer* buffer);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetControllerVibrationState(
    ovrSession session,
    ovrControllerType controllerType,
    ovrHapticsPlaybackState* outState);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_TestBoundary(
    ovrSession session,
    ovrTrackedDeviceType deviceBitmask,
    ovrBoundaryType boundaryType,
    ovrBoundaryTestResult* outTestResult);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_TestBoundaryPoint(
    ovrSession session,
const ovrVector3f* point,
    ovrBoundaryType singleBoundaryType,
    ovrBoundaryTestResult* outTestResult);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SetBoundaryLookAndFeel(ovrSession session, const ovrBoundaryLookAndFeel* lookAndFeel);

OVR_PUBLIC_FUNCTION(ovrResult) ovr_ResetBoundaryLookAndFeel(ovrSession session);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetBoundaryGeometry(
    ovrSession session,
    ovrBoundaryType boundaryType,
    ovrVector3f* outFloorPoints,
int* outFloorPointsCount);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetBoundaryDimensions(
    ovrSession session,
    ovrBoundaryType boundaryType,
    ovrVector3f* outDimensions);

OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetBoundaryVisible(ovrSession session, ovrBool* outIsVisible);

OVR_PUBLIC_FUNCTION(ovrResult) ovr_RequestBoundaryVisible(ovrSession session, ovrBool visible);


#endif // !defined(OVR_EXPORTING_CAPI)

//-------------------------------------------------------------------------------------
// @name Layers
//

enum { ovrMaxLayerCount = 16 };

typedefenum ovrLayerType_ {
  ovrLayerType_Disabled = 0,

  ovrLayerType_EyeFov = 1,


  ovrLayerType_Quad = 3,

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

  ovrLayerType_EyeMatrix = 5,


  ovrLayerType_EnumSize = 0x7fffffff 

} ovrLayerType;

typedefenum ovrLayerFlags_ {
  ovrLayerFlag_HighQuality = 0x01,

  ovrLayerFlag_TextureOriginAtBottomLeft = 0x02,

  ovrLayerFlag_HeadLocked = 0x04

} ovrLayerFlags;

typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerHeader_ {
  ovrLayerType Type; 
unsigned Flags; 
} ovrLayerHeader;

typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeFov_ {
  ovrLayerHeader Header;

  ovrTextureSwapChain ColorTexture[ovrEye_Count];

  ovrRecti Viewport[ovrEye_Count];

  ovrFovPort Fov[ovrEye_Count];

  ovrPosef RenderPose[ovrEye_Count];

double SensorSampleTime;

} ovrLayerEyeFov;


typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeMatrix_ {
  ovrLayerHeader Header;

  ovrTextureSwapChain ColorTexture[ovrEye_Count];

  ovrRecti Viewport[ovrEye_Count];

  ovrPosef RenderPose[ovrEye_Count];

  ovrMatrix4f Matrix[ovrEye_Count];

double SensorSampleTime;

} ovrLayerEyeMatrix;

typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerQuad_ {
  ovrLayerHeader Header;

  ovrTextureSwapChain ColorTexture;

  ovrRecti Viewport;

  ovrPosef QuadPoseCenter;

  ovrVector2f QuadSize;

} ovrLayerQuad;



typedefunion ovrLayer_Union_ {
  ovrLayerHeader Header;
  ovrLayerEyeFov EyeFov;
  ovrLayerQuad Quad;
} ovrLayer_Union;


#if !defined(OVR_EXPORTING_CAPI)




OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetTextureSwapChainLength(ovrSession session, ovrTextureSwapChain chain, int* out_Length);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetTextureSwapChainCurrentIndex(ovrSession session, ovrTextureSwapChain chain, int* out_Index);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetTextureSwapChainDesc(
    ovrSession session,
    ovrTextureSwapChain chain,
    ovrTextureSwapChainDesc* out_Desc);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_CommitTextureSwapChain(ovrSession session, ovrTextureSwapChain chain);

OVR_PUBLIC_FUNCTION(void)
ovr_DestroyTextureSwapChain(ovrSession session, ovrTextureSwapChain chain);


OVR_PUBLIC_FUNCTION(void)
ovr_DestroyMirrorTexture(ovrSession session, ovrMirrorTexture mirrorTexture);

OVR_PUBLIC_FUNCTION(ovrSizei)
ovr_GetFovTextureSize(
    ovrSession session,
    ovrEyeType eye,
    ovrFovPort fov,
float pixelsPerDisplayPixel);

OVR_PUBLIC_FUNCTION(ovrEyeRenderDesc)
ovr_GetRenderDesc(ovrSession session, ovrEyeType eyeType, ovrFovPort fov);


OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SubmitFrame(
    ovrSession session,
longlong frameIndex,
const ovrViewScaleDesc* viewScaleDesc,
    ovrLayerHeader const* const* layerPtrList,
unsignedint layerCount);

#endif // !defined(OVR_EXPORTING_CAPI)

//-------------------------------------------------------------------------------------


typedefstruct OVR_ALIGNAS(4) ovrPerfStatsPerCompositorFrame_ {
int HmdVsyncIndex;


int AppFrameIndex;

int AppDroppedFrameCount;

float AppMotionToPhotonLatency;

float AppQueueAheadTime;

float AppCpuElapsedTime;

float AppGpuElapsedTime;


int CompositorFrameIndex;

int CompositorDroppedFrameCount;

float CompositorLatency;

float CompositorCpuElapsedTime;

float CompositorGpuElapsedTime;

float CompositorCpuStartToGpuEndElapsedTime;

float CompositorGpuEndToVsyncElapsedTime;


  ovrBool AswIsActive;

int AswActivatedToggleCount;

int AswPresentedFrameCount;

int AswFailedFrameCount;

} ovrPerfStatsPerCompositorFrame;

enum { ovrMaxProvidedFrameStats = 5 };

typedefstruct OVR_ALIGNAS(4) ovrPerfStats_ {
  ovrPerfStatsPerCompositorFrame FrameStats[ovrMaxProvidedFrameStats];
int FrameStatsCount;

  ovrBool AnyFrameStatsDropped;

float AdaptiveGpuPerformanceScale;

  ovrBool AswIsAvailable;

  ovrProcessId VisibleProcessId;
} ovrPerfStats;

#if !defined(OVR_EXPORTING_CAPI)

OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetPerfStats(ovrSession session, ovrPerfStats* outStats);

OVR_PUBLIC_FUNCTION(ovrResult) ovr_ResetPerfStats(ovrSession session);

OVR_PUBLIC_FUNCTION(double) ovr_GetPredictedDisplayTime(ovrSession session, longlong frameIndex);

OVR_PUBLIC_FUNCTION(double) ovr_GetTimeInSeconds();

#endif // !defined(OVR_EXPORTING_CAPI)

typedefenum ovrPerfHudMode_ {
  ovrPerfHud_Off = 0, 
  ovrPerfHud_PerfSummary = 1, 
  ovrPerfHud_LatencyTiming = 2, 
  ovrPerfHud_AppRenderTiming = 3, 
  ovrPerfHud_CompRenderTiming = 4, 
  ovrPerfHud_AswStats = 6, 
  ovrPerfHud_VersionInfo = 5, 
  ovrPerfHud_Count = 7, 
  ovrPerfHud_EnumSize = 0x7fffffff 
} ovrPerfHudMode;

typedefenum ovrLayerHudMode_ {
  ovrLayerHud_Off = 0, 
  ovrLayerHud_Info = 1, 
  ovrLayerHud_EnumSize = 0x7fffffff
} ovrLayerHudMode;


typedefenum ovrDebugHudStereoMode_ {
  ovrDebugHudStereo_Off = 0,

  ovrDebugHudStereo_Quad = 1,

  ovrDebugHudStereo_QuadWithCrosshair = 2,

  ovrDebugHudStereo_CrosshairAtInfinity = 3,

  ovrDebugHudStereo_Count,

  ovrDebugHudStereo_EnumSize = 0x7fffffff 
} ovrDebugHudStereoMode;


#if !defined(OVR_EXPORTING_CAPI)

// -----------------------------------------------------------------------------------


OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetExternalCameras(
    ovrSession session,
    ovrExternalCamera* cameras,
unsignedint* inoutCameraCount);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SetExternalCameraProperties(
    ovrSession session,
constchar* name,
const ovrCameraIntrinsics* const intrinsics,
const ovrCameraExtrinsics* const extrinsics);


#endif // OVR_EXPORTING_CAPI

#if !defined(OVR_EXPORTING_CAPI)

// -----------------------------------------------------------------------------------


OVR_PUBLIC_FUNCTION(ovrBool)
ovr_GetBool(ovrSession session, constchar* propertyName, ovrBool defaultVal);

OVR_PUBLIC_FUNCTION(ovrBool)
ovr_SetBool(ovrSession session, constchar* propertyName, ovrBool value);

OVR_PUBLIC_FUNCTION(int) ovr_GetInt(ovrSession session, constchar* propertyName, int defaultVal);

OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetInt(ovrSession session, constchar* propertyName, int value);

OVR_PUBLIC_FUNCTION(float)
ovr_GetFloat(ovrSession session, constchar* propertyName, float defaultVal);

OVR_PUBLIC_FUNCTION(ovrBool)
ovr_SetFloat(ovrSession session, constchar* propertyName, float value);

OVR_PUBLIC_FUNCTION(unsignedint)
ovr_GetFloatArray(
    ovrSession session,
constchar* propertyName,
float values[],
unsignedint valuesCapacity);

OVR_PUBLIC_FUNCTION(ovrBool)
ovr_SetFloatArray(
    ovrSession session,
constchar* propertyName,
constfloat values[],
unsignedint valuesSize);

OVR_PUBLIC_FUNCTION(constchar*)
ovr_GetString(ovrSession session, constchar* propertyName, constchar* defaultVal);

OVR_PUBLIC_FUNCTION(ovrBool)
ovr_SetString(ovrSession session, constchar* propertyName, constchar* value);


#endif // !defined(OVR_EXPORTING_CAPI)

#ifdef __cplusplus
} // extern "C"
#endif

#if defined(_MSC_VER)
#pragma warning(pop)
#endif



// -----------------------------------------------------------------------------------
// ***** Backward compatibility #includes
//
// This is at the bottom of this file because the following is dependent on the
// declarations above.

#if !defined(OVR_CAPI_NO_UTILS)
#include "Extras/OVR_CAPI_Util.h"
#endif


#endif // OVR_CAPI_h
The documentation for this file was generated from the following file: Include/OVR_CAPI.h