+/************************************************************************************\r
+ \file OVR_CAPI.h\r
+ \brief C Interface to the Oculus PC SDK tracking and rendering library.\r
+ \copyright Copyright 2014 Oculus VR, LLC All Rights reserved.\r
+ ************************************************************************************/\r
+\r
+// We don't use version numbers within OVR_CAPI_h, as all versioned variations\r
+// of this file are currently mutually exclusive.\r
+#ifndef OVR_CAPI_h\r
+#define OVR_CAPI_h\r
+\r
+#include "OVR_CAPI_Keys.h"\r
+#include "OVR_Version.h"\r
+#include "OVR_ErrorCode.h"\r
+\r
+#if !defined(_WIN32)\r
+#include <sys/types.h>\r
+#endif\r
+\r
+\r
+#include <stdint.h>\r
+\r
+#if defined(_MSC_VER)\r
+#pragma warning(push)\r
+#pragma warning(disable : 4324) // structure was padded due to __declspec(align())\r
+#pragma warning(disable : 4359) // The alignment specified for a type is less than the\r
+// alignment of the type of one of its data members\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** OVR_OS\r
+//\r
+#if !defined(OVR_OS_WIN32) && defined(_WIN32)\r
+#define OVR_OS_WIN32\r
+#endif\r
+\r
+#if !defined(OVR_OS_MAC) && defined(__APPLE__)\r
+#define OVR_OS_MAC\r
+#endif\r
+\r
+#if !defined(OVR_OS_LINUX) && defined(__linux__)\r
+#define OVR_OS_LINUX\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** OVR_CPP\r
+//\r
+#if !defined(OVR_CPP)\r
+#if defined(__cplusplus)\r
+#define OVR_CPP(x) x\r
+#else\r
+#define OVR_CPP(x) /* Not C++ */\r
+#endif\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** OVR_CDECL\r
+//\r
+/// LibOVR calling convention for 32-bit Windows builds.\r
+//\r
+#if !defined(OVR_CDECL)\r
+#if defined(_WIN32)\r
+#define OVR_CDECL __cdecl\r
+#else\r
+#define OVR_CDECL\r
+#endif\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** OVR_EXTERN_C\r
+//\r
+/// Defined as extern "C" when built from C++ code.\r
+//\r
+#if !defined(OVR_EXTERN_C)\r
+#ifdef __cplusplus\r
+#define OVR_EXTERN_C extern "C"\r
+#else\r
+#define OVR_EXTERN_C\r
+#endif\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** OVR_PUBLIC_FUNCTION / OVR_PRIVATE_FUNCTION\r
+//\r
+// OVR_PUBLIC_FUNCTION - Functions that externally visible from a shared library.\r
+// Corresponds to Microsoft __dllexport.\r
+// OVR_PUBLIC_CLASS - C++ structs and classes that are externally visible from a\r
+// shared library. Corresponds to Microsoft __dllexport.\r
+// OVR_PRIVATE_FUNCTION - Functions that are not visible outside of a shared library.\r
+// They are private to the shared library.\r
+// OVR_PRIVATE_CLASS - C++ structs and classes that are not visible outside of a\r
+// shared library. They are private to the shared library.\r
+//\r
+// OVR_DLL_BUILD - Used to indicate that the current compilation unit is of a shared library.\r
+// OVR_DLL_IMPORT - Used to indicate that the current compilation unit is a\r
+// user of the corresponding shared library.\r
+// OVR_STATIC_BUILD - used to indicate that the current compilation unit is not a\r
+// shared library but rather statically linked code.\r
+//\r
+#if !defined(OVR_PUBLIC_FUNCTION)\r
+#if defined(OVR_DLL_BUILD)\r
+#if defined(_WIN32)\r
+#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C __declspec(dllexport) rval OVR_CDECL\r
+#define OVR_PUBLIC_CLASS __declspec(dllexport)\r
+#define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL\r
+#define OVR_PRIVATE_CLASS\r
+#else\r
+#define OVR_PUBLIC_FUNCTION(rval) \\r
+ OVR_EXTERN_C __attribute__((visibility("default"))) rval OVR_CDECL /* Requires GCC 4.0+ */\r
+#define OVR_PUBLIC_CLASS __attribute__((visibility("default"))) /* Requires GCC 4.0+ */\r
+#define OVR_PRIVATE_FUNCTION(rval) __attribute__((visibility("hidden"))) rval OVR_CDECL\r
+#define OVR_PRIVATE_CLASS __attribute__((visibility("hidden")))\r
+#endif\r
+#elif defined(OVR_DLL_IMPORT)\r
+#if defined(_WIN32)\r
+#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C __declspec(dllimport) rval OVR_CDECL\r
+#define OVR_PUBLIC_CLASS __declspec(dllimport)\r
+#else\r
+#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C rval OVR_CDECL\r
+#define OVR_PUBLIC_CLASS\r
+#endif\r
+#define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL\r
+#define OVR_PRIVATE_CLASS\r
+#else // OVR_STATIC_BUILD\r
+#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C rval OVR_CDECL\r
+#define OVR_PUBLIC_CLASS\r
+#define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL\r
+#define OVR_PRIVATE_CLASS\r
+#endif\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** OVR_EXPORT\r
+//\r
+/// Provided for backward compatibility with older versions of this library.\r
+//\r
+#if !defined(OVR_EXPORT)\r
+#ifdef OVR_OS_WIN32\r
+#define OVR_EXPORT __declspec(dllexport)\r
+#else\r
+#define OVR_EXPORT\r
+#endif\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** OVR_ALIGNAS\r
+//\r
+#if !defined(OVR_ALIGNAS)\r
+#if defined(__GNUC__) || defined(__clang__)\r
+#define OVR_ALIGNAS(n) __attribute__((aligned(n)))\r
+#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)\r
+#define OVR_ALIGNAS(n) __declspec(align(n))\r
+#elif defined(__CC_ARM)\r
+#define OVR_ALIGNAS(n) __align(n)\r
+#else\r
+#error Need to define OVR_ALIGNAS\r
+#endif\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** OVR_CC_HAS_FEATURE\r
+//\r
+// This is a portable way to use compile-time feature identification available\r
+// with some compilers in a clean way. Direct usage of __has_feature in preprocessing\r
+// statements of non-supporting compilers results in a preprocessing error.\r
+//\r
+// Example usage:\r
+// #if OVR_CC_HAS_FEATURE(is_pod)\r
+// if(__is_pod(T)) // If the type is plain data then we can safely memcpy it.\r
+// memcpy(&destObject, &srcObject, sizeof(object));\r
+// #endif\r
+//\r
+#if !defined(OVR_CC_HAS_FEATURE)\r
+#if defined(__clang__) // http://clang.llvm.org/docs/LanguageExtensions.html#id2\r
+#define OVR_CC_HAS_FEATURE(x) __has_feature(x)\r
+#else\r
+#define OVR_CC_HAS_FEATURE(x) 0\r
+#endif\r
+#endif\r
+\r
+// ------------------------------------------------------------------------\r
+// ***** OVR_STATIC_ASSERT\r
+//\r
+// Portable support for C++11 static_assert().\r
+// Acts as if the following were declared:\r
+// void OVR_STATIC_ASSERT(bool const_expression, const char* msg);\r
+//\r
+// Example usage:\r
+// OVR_STATIC_ASSERT(sizeof(int32_t) == 4, "int32_t expected to be 4 bytes.");\r
+\r
+#if !defined(OVR_STATIC_ASSERT)\r
+#if !(defined(__cplusplus) && (__cplusplus >= 201103L)) /* Other */ && \\r
+ !(defined(__GXX_EXPERIMENTAL_CXX0X__)) /* GCC */ && \\r
+ !(defined(__clang__) && defined(__cplusplus) && \\r
+ OVR_CC_HAS_FEATURE(cxx_static_assert)) /* clang */ \\r
+ && !(defined(_MSC_VER) && (_MSC_VER >= 1600) && defined(__cplusplus)) /* VS2010+ */\r
+\r
+#if !defined(OVR_SA_UNUSED)\r
+#if defined(OVR_CC_GNU) || defined(OVR_CC_CLANG)\r
+#define OVR_SA_UNUSED __attribute__((unused))\r
+#else\r
+#define OVR_SA_UNUSED\r
+#endif\r
+#define OVR_SA_PASTE(a, b) a##b\r
+#define OVR_SA_HELP(a, b) OVR_SA_PASTE(a, b)\r
+#endif\r
+\r
+#if defined(__COUNTER__)\r
+#define OVR_STATIC_ASSERT(expression, msg) \\r
+ typedef char OVR_SA_HELP(staticAssert, __COUNTER__)[((expression) != 0) ? 1 : -1] OVR_SA_UNUSED\r
+#else\r
+#define OVR_STATIC_ASSERT(expression, msg) \\r
+ typedef char OVR_SA_HELP(staticAssert, __LINE__)[((expression) != 0) ? 1 : -1] OVR_SA_UNUSED\r
+#endif\r
+\r
+#else\r
+#define OVR_STATIC_ASSERT(expression, msg) static_assert(expression, msg)\r
+#endif\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** Padding\r
+//\r
+/// Defines explicitly unused space for a struct.\r
+/// When used correcly, usage of this macro should not change the size of the struct.\r
+/// Compile-time and runtime behavior with and without this defined should be identical.\r
+///\r
+#if !defined(OVR_UNUSED_STRUCT_PAD)\r
+#define OVR_UNUSED_STRUCT_PAD(padName, size) char padName[size];\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** Word Size\r
+//\r
+/// Specifies the size of a pointer on the given platform.\r
+///\r
+#if !defined(OVR_PTR_SIZE)\r
+#if defined(__WORDSIZE)\r
+#define OVR_PTR_SIZE ((__WORDSIZE) / 8)\r
+#elif defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(_M_IA64) || \\r
+ defined(__ia64__) || defined(__arch64__) || defined(__64BIT__) || defined(__Ptr_Is_64)\r
+#define OVR_PTR_SIZE 8\r
+#elif defined(__CC_ARM) && (__sizeof_ptr == 8)\r
+#define OVR_PTR_SIZE 8\r
+#else\r
+#define OVR_PTR_SIZE 4\r
+#endif\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** OVR_ON32 / OVR_ON64\r
+//\r
+#if OVR_PTR_SIZE == 8\r
+#define OVR_ON32(x)\r
+#define OVR_ON64(x) x\r
+#else\r
+#define OVR_ON32(x) x\r
+#define OVR_ON64(x)\r
+#endif\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** ovrBool\r
+\r
+typedef char ovrBool; ///< Boolean type\r
+#define ovrFalse 0 ///< ovrBool value of false.\r
+#define ovrTrue 1 ///< ovrBool value of true.\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** Simple Math Structures\r
+\r
+/// A RGBA color with normalized float components.\r
+typedef struct OVR_ALIGNAS(4) ovrColorf_ {\r
+ float r, g, b, a;\r
+} ovrColorf;\r
+\r
+/// A 2D vector with integer components.\r
+typedef struct OVR_ALIGNAS(4) ovrVector2i_ {\r
+ int x, y;\r
+} ovrVector2i;\r
+\r
+/// A 2D size with integer components.\r
+typedef struct OVR_ALIGNAS(4) ovrSizei_ {\r
+ int w, h;\r
+} ovrSizei;\r
+\r
+/// A 2D rectangle with a position and size.\r
+/// All components are integers.\r
+typedef struct OVR_ALIGNAS(4) ovrRecti_ {\r
+ ovrVector2i Pos;\r
+ ovrSizei Size;\r
+} ovrRecti;\r
+\r
+/// A quaternion rotation.\r
+typedef struct OVR_ALIGNAS(4) ovrQuatf_ {\r
+ float x, y, z, w;\r
+} ovrQuatf;\r
+\r
+/// A 2D vector with float components.\r
+typedef struct OVR_ALIGNAS(4) ovrVector2f_ {\r
+ float x, y;\r
+} ovrVector2f;\r
+\r
+/// A 3D vector with float components.\r
+typedef struct OVR_ALIGNAS(4) ovrVector3f_ {\r
+ float x, y, z;\r
+} ovrVector3f;\r
+\r
+/// A 4x4 matrix with float elements.\r
+typedef struct OVR_ALIGNAS(4) ovrMatrix4f_ {\r
+ float M[4][4];\r
+} ovrMatrix4f;\r
+\r
+/// Position and orientation together.\r
+/// The coordinate system used is right-handed Cartesian.\r
+typedef struct OVR_ALIGNAS(4) ovrPosef_ {\r
+ ovrQuatf Orientation;\r
+ ovrVector3f Position;\r
+} ovrPosef;\r
+\r
+/// A full pose (rigid body) configuration with first and second derivatives.\r
+///\r
+/// Body refers to any object for which ovrPoseStatef is providing data.\r
+/// It can be the HMD, Touch controller, sensor or something else. The context\r
+/// depends on the usage of the struct.\r
+typedef struct OVR_ALIGNAS(8) ovrPoseStatef_ {\r
+ ovrPosef ThePose; ///< Position and orientation.\r
+ ovrVector3f AngularVelocity; ///< Angular velocity in radians per second.\r
+ ovrVector3f LinearVelocity; ///< Velocity in meters per second.\r
+ ovrVector3f AngularAcceleration; ///< Angular acceleration in radians per second per second.\r
+ ovrVector3f LinearAcceleration; ///< Acceleration in meters per second per second.\r
+ OVR_UNUSED_STRUCT_PAD(pad0, 4) ///< \internal struct pad.\r
+ double TimeInSeconds; ///< Absolute time that this pose refers to. \see ovr_GetTimeInSeconds\r
+} ovrPoseStatef;\r
+\r
+/// Describes the up, down, left, and right angles of the field of view.\r
+///\r
+/// Field Of View (FOV) tangent of the angle units.\r
+/// \note For a standard 90 degree vertical FOV, we would\r
+/// have: { UpTan = tan(90 degrees / 2), DownTan = tan(90 degrees / 2) }.\r
+typedef struct OVR_ALIGNAS(4) ovrFovPort_ {\r
+ float UpTan; ///< Tangent of the angle between the viewing vector and top edge of the FOV.\r
+ float DownTan; ///< Tangent of the angle between the viewing vector and bottom edge of the FOV.\r
+ float LeftTan; ///< Tangent of the angle between the viewing vector and left edge of the FOV.\r
+ float RightTan; ///< Tangent of the angle between the viewing vector and right edge of the FOV.\r
+} ovrFovPort;\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** HMD Types\r
+\r
+/// Enumerates all HMD types that we support.\r
+///\r
+/// The currently released developer kits are ovrHmd_DK1 and ovrHmd_DK2.\r
+/// The other enumerations are for internal use only.\r
+typedef enum ovrHmdType_ {\r
+ ovrHmd_None = 0,\r
+ ovrHmd_DK1 = 3,\r
+ ovrHmd_DKHD = 4,\r
+ ovrHmd_DK2 = 6,\r
+ ovrHmd_CB = 8,\r
+ ovrHmd_Other = 9,\r
+ ovrHmd_E3_2015 = 10,\r
+ ovrHmd_ES06 = 11,\r
+ ovrHmd_ES09 = 12,\r
+ ovrHmd_ES11 = 13,\r
+ ovrHmd_CV1 = 14,\r
+\r
+ ovrHmd_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrHmdType;\r
+\r
+/// HMD capability bits reported by device.\r
+///\r
+typedef enum ovrHmdCaps_ {\r
+ // Read-only flags\r
+\r
+ /// <B>(read only)</B> Specifies that the HMD is a virtual debug device.\r
+ ovrHmdCap_DebugDevice = 0x0010,\r
+\r
+\r
+ ovrHmdCap_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrHmdCaps;\r
+\r
+/// Tracking capability bits reported by the device.\r
+/// Used with ovr_GetTrackingCaps.\r
+typedef enum ovrTrackingCaps_ {\r
+ ovrTrackingCap_Orientation = 0x0010, ///< Supports orientation tracking (IMU).\r
+ ovrTrackingCap_MagYawCorrection = 0x0020, ///< Supports yaw drift correction.\r
+ ovrTrackingCap_Position = 0x0040, ///< Supports positional tracking.\r
+ ovrTrackingCap_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrTrackingCaps;\r
+\r
+/// Optional extensions\r
+typedef enum ovrExtensions_ {\r
+ ovrExtension_TextureLayout_Octilinear = 0, ///< Enable before first layer submission.\r
+ ovrExtension_Count, ///< \internal Sanity checking\r
+ ovrExtension_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrExtensions;\r
+\r
+/// Specifies which eye is being used for rendering.\r
+/// This type explicitly does not include a third "NoStereo" monoscopic option,\r
+/// as such is not required for an HMD-centered API.\r
+typedef enum ovrEyeType_ {\r
+ ovrEye_Left = 0, ///< The left eye, from the viewer's perspective.\r
+ ovrEye_Right = 1, ///< The right eye, from the viewer's perspective.\r
+ ovrEye_Count = 2, ///< \internal Count of enumerated elements.\r
+ ovrEye_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrEyeType;\r
+\r
+/// Specifies the coordinate system ovrTrackingState returns tracking poses in.\r
+/// Used with ovr_SetTrackingOriginType()\r
+typedef enum ovrTrackingOrigin_ {\r
+ /// \brief Tracking system origin reported at eye (HMD) height\r
+ /// \details Prefer using this origin when your application requires\r
+ /// matching user's current physical head pose to a virtual head pose\r
+ /// without any regards to a the height of the floor. Cockpit-based,\r
+ /// or 3rd-person experiences are ideal candidates.\r
+ /// When used, all poses in ovrTrackingState are reported as an offset\r
+ /// transform from the profile calibrated or recentered HMD pose.\r
+ /// It is recommended that apps using this origin type call ovr_RecenterTrackingOrigin\r
+ /// prior to starting the VR experience, but notify the user before doing so\r
+ /// to make sure the user is in a comfortable pose, facing a comfortable\r
+ /// direction.\r
+ ovrTrackingOrigin_EyeLevel = 0,\r
+\r
+ /// \brief Tracking system origin reported at floor height\r
+ /// \details Prefer using this origin when your application requires the\r
+ /// physical floor height to match the virtual floor height, such as\r
+ /// standing experiences.\r
+ /// When used, all poses in ovrTrackingState are reported as an offset\r
+ /// transform from the profile calibrated floor pose. Calling ovr_RecenterTrackingOrigin\r
+ /// will recenter the X & Z axes as well as yaw, but the Y-axis (i.e. height) will continue\r
+ /// to be reported using the floor height as the origin for all poses.\r
+ ovrTrackingOrigin_FloorLevel = 1,\r
+\r
+ ovrTrackingOrigin_Count = 2, ///< \internal Count of enumerated elements.\r
+ ovrTrackingOrigin_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrTrackingOrigin;\r
+\r
+/// Identifies a graphics device in a platform-specific way.\r
+/// For Windows this is a LUID type.\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrGraphicsLuid_ {\r
+ // Public definition reserves space for graphics API-specific implementation\r
+ char Reserved[8];\r
+} ovrGraphicsLuid;\r
+\r
+/// This is a complete descriptor of the HMD.\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrHmdDesc_ {\r
+ ovrHmdType Type; ///< The type of HMD.\r
+ OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad0, 4)) ///< \internal struct paddding.\r
+ char ProductName[64]; ///< UTF8-encoded product identification string (e.g. "Oculus Rift DK1").\r
+ char Manufacturer[64]; ///< UTF8-encoded HMD manufacturer identification string.\r
+ short VendorId; ///< HID (USB) vendor identifier of the device.\r
+ short ProductId; ///< HID (USB) product identifier of the device.\r
+ char SerialNumber[24]; ///< HMD serial number.\r
+ short FirmwareMajor; ///< HMD firmware major version.\r
+ short FirmwareMinor; ///< HMD firmware minor version.\r
+ unsigned int AvailableHmdCaps; ///< Available ovrHmdCaps bits.\r
+ unsigned int DefaultHmdCaps; ///< Default ovrHmdCaps bits.\r
+ unsigned int AvailableTrackingCaps; ///< Available ovrTrackingCaps bits.\r
+ unsigned int DefaultTrackingCaps; ///< Default ovrTrackingCaps bits.\r
+ ovrFovPort DefaultEyeFov[ovrEye_Count]; ///< Defines the recommended FOVs for the HMD.\r
+ ovrFovPort MaxEyeFov[ovrEye_Count]; ///< Defines the maximum FOVs for the HMD.\r
+ ovrSizei Resolution; ///< Resolution of the full HMD screen (both eyes) in pixels.\r
+ float DisplayRefreshRate; ///< Refresh rate of the display in cycles per second.\r
+ OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad1, 4)) ///< \internal struct paddding.\r
+} ovrHmdDesc;\r
+\r
+/// Used as an opaque pointer to an OVR session.\r
+typedef struct ovrHmdStruct* ovrSession;\r
+\r
+#ifdef OVR_OS_WIN32\r
+typedef uint32_t ovrProcessId;\r
+#else\r
+typedef pid_t ovrProcessId;\r
+#endif\r
+\r
+/// Fallback definitions for when the vulkan header isn't being included\r
+#if !defined(VK_VERSION_1_0)\r
+// From <vulkan/vulkan.h>:\r
+#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;\r
+#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || \\r
+ defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || \\r
+ defined(__powerpc64__)\r
+#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T* object;\r
+#else\r
+#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;\r
+#endif\r
+VK_DEFINE_HANDLE(VkInstance)\r
+VK_DEFINE_HANDLE(VkPhysicalDevice)\r
+VK_DEFINE_HANDLE(VkDevice)\r
+VK_DEFINE_HANDLE(VkQueue)\r
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage)\r
+#endif\r
+\r
+/// Bit flags describing the current status of sensor tracking.\r
+/// The values must be the same as in enum StatusBits\r
+///\r
+/// \see ovrTrackingState\r
+///\r
+typedef enum ovrStatusBits_ {\r
+ ovrStatus_OrientationTracked = 0x0001, ///< Orientation is currently tracked (connected & in use).\r
+ ovrStatus_PositionTracked = 0x0002, ///< Position is currently tracked (false if out of range).\r
+ ovrStatus_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrStatusBits;\r
+\r
+/// Specifies the description of a single sensor.\r
+///\r
+/// \see ovr_GetTrackerDesc\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTrackerDesc_ {\r
+ float FrustumHFovInRadians; ///< Sensor frustum horizontal field-of-view (if present).\r
+ float FrustumVFovInRadians; ///< Sensor frustum vertical field-of-view (if present).\r
+ float FrustumNearZInMeters; ///< Sensor frustum near Z (if present).\r
+ float FrustumFarZInMeters; ///< Sensor frustum far Z (if present).\r
+} ovrTrackerDesc;\r
+\r
+/// Specifies sensor flags.\r
+///\r
+/// /see ovrTrackerPose\r
+///\r
+typedef enum ovrTrackerFlags_ {\r
+ /// The sensor is present, else the sensor is absent or offline.\r
+ ovrTracker_Connected = 0x0020,\r
+\r
+ /// The sensor has a valid pose, else the pose is unavailable.\r
+ /// This will only be set if ovrTracker_Connected is set.\r
+ ovrTracker_PoseTracked = 0x0004\r
+} ovrTrackerFlags;\r
+\r
+/// Specifies the pose for a single sensor.\r
+///\r
+typedef struct OVR_ALIGNAS(8) _ovrTrackerPose {\r
+ /// ovrTrackerFlags.\r
+ unsigned int TrackerFlags;\r
+\r
+ /// The sensor's pose. This pose includes sensor tilt (roll and pitch).\r
+ /// For a leveled coordinate system use LeveledPose.\r
+ ovrPosef Pose;\r
+\r
+ /// The sensor's leveled pose, aligned with gravity. This value includes pos and yaw of the\r
+ /// sensor, but not roll and pitch. It can be used as a reference point to render real-world\r
+ /// objects in the correct location.\r
+ ovrPosef LeveledPose;\r
+\r
+ OVR_UNUSED_STRUCT_PAD(pad0, 4) ///< \internal struct pad.\r
+} ovrTrackerPose;\r
+\r
+/// Tracking state at a given absolute time (describes predicted HMD pose, etc.).\r
+/// Returned by ovr_GetTrackingState.\r
+///\r
+/// \see ovr_GetTrackingState\r
+///\r
+typedef struct OVR_ALIGNAS(8) ovrTrackingState_ {\r
+ /// Predicted head pose (and derivatives) at the requested absolute time.\r
+ ovrPoseStatef HeadPose;\r
+\r
+ /// HeadPose tracking status described by ovrStatusBits.\r
+ unsigned int StatusFlags;\r
+\r
+ /// The most recent calculated pose for each hand when hand controller tracking is present.\r
+ /// HandPoses[ovrHand_Left] refers to the left hand and HandPoses[ovrHand_Right] to the right.\r
+ /// These values can be combined with ovrInputState for complete hand controller information.\r
+ ovrPoseStatef HandPoses[2];\r
+\r
+ /// HandPoses status flags described by ovrStatusBits.\r
+ /// Only ovrStatus_OrientationTracked and ovrStatus_PositionTracked are reported.\r
+ unsigned int HandStatusFlags[2];\r
+\r
+ /// The pose of the origin captured during calibration.\r
+ /// Like all other poses here, this is expressed in the space set by ovr_RecenterTrackingOrigin,\r
+ /// or ovr_SpecifyTrackingOrigin and so will change every time either of those functions are\r
+ /// called. This pose can be used to calculate where the calibrated origin lands in the new\r
+ /// recentered space. If an application never calls ovr_RecenterTrackingOrigin or\r
+ /// ovr_SpecifyTrackingOrigin, expect this value to be the identity pose and as such will point\r
+ /// respective origin based on ovrTrackingOrigin requested when calling ovr_GetTrackingState.\r
+ ovrPosef CalibratedOrigin;\r
+\r
+} ovrTrackingState;\r
+\r
+\r
+\r
+/// Rendering information for each eye. Computed by ovr_GetRenderDesc() based on the\r
+/// specified FOV. Note that the rendering viewport is not included\r
+/// here as it can be specified separately and modified per frame by\r
+/// passing different Viewport values in the layer structure.\r
+///\r
+/// \see ovr_GetRenderDesc\r
+///\r
+typedef struct OVR_ALIGNAS(4) ovrEyeRenderDesc_ {\r
+ ovrEyeType Eye; ///< The eye index to which this instance corresponds.\r
+ ovrFovPort Fov; ///< The field of view.\r
+ ovrRecti DistortedViewport; ///< Distortion viewport.\r
+ ovrVector2f PixelsPerTanAngleAtCenter; ///< How many display pixels will fit in tan(angle) = 1.\r
+ ovrPosef HmdToEyePose; ///< Transform of eye from the HMD center, in meters.\r
+} ovrEyeRenderDesc;\r
+\r
+/// Projection information for ovrLayerEyeFovDepth.\r
+///\r
+/// Use the utility function ovrTimewarpProjectionDesc_FromProjection to\r
+/// generate this structure from the application's projection matrix.\r
+///\r
+/// \see ovrLayerEyeFovDepth, ovrTimewarpProjectionDesc_FromProjection\r
+///\r
+typedef struct OVR_ALIGNAS(4) ovrTimewarpProjectionDesc_ {\r
+ float Projection22; ///< Projection matrix element [2][2].\r
+ float Projection23; ///< Projection matrix element [2][3].\r
+ float Projection32; ///< Projection matrix element [3][2].\r
+} ovrTimewarpProjectionDesc;\r
+\r
+\r
+/// Contains the data necessary to properly calculate position info for various layer types.\r
+/// - HmdToEyePose is the same value-pair provided in ovrEyeRenderDesc. Modifying this value is\r
+/// suggested only if the app is forcing monoscopic rendering and requires that all layers\r
+/// including quad layers show up in a monoscopic fashion.\r
+/// - HmdSpaceToWorldScaleInMeters is used to scale player motion into in-application units.\r
+/// In other words, it is how big an in-application unit is in the player's physical meters.\r
+/// For example, if the application uses inches as its units then HmdSpaceToWorldScaleInMeters\r
+/// would be 0.0254.\r
+/// Note that if you are scaling the player in size, this must also scale. So if your application\r
+/// units are inches, but you're shrinking the player to half their normal size, then\r
+/// HmdSpaceToWorldScaleInMeters would be 0.0254*2.0.\r
+///\r
+/// \see ovrEyeRenderDesc, ovr_SubmitFrame\r
+///\r
+typedef struct OVR_ALIGNAS(4) ovrViewScaleDesc_ {\r
+ ovrPosef HmdToEyePose[ovrEye_Count]; ///< Transform of each eye from the HMD center, in meters.\r
+ float HmdSpaceToWorldScaleInMeters; ///< Ratio of viewer units to meter units.\r
+} ovrViewScaleDesc;\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** Platform-independent Rendering Configuration\r
+\r
+/// The type of texture resource.\r
+///\r
+/// \see ovrTextureSwapChainDesc\r
+///\r
+typedef enum ovrTextureType_ {\r
+ ovrTexture_2D, ///< 2D textures.\r
+ ovrTexture_2D_External, ///< Application-provided 2D texture. Not supported on PC.\r
+ ovrTexture_Cube, ///< Cube maps. ovrTextureSwapChainDesc::ArraySize must be 6 for this type.\r
+ ovrTexture_Count,\r
+ ovrTexture_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrTextureType;\r
+\r
+/// The bindings required for texture swap chain.\r
+///\r
+/// All texture swap chains are automatically bindable as shader\r
+/// input resources since the Oculus runtime needs this to read them.\r
+///\r
+/// \see ovrTextureSwapChainDesc\r
+///\r
+typedef enum ovrTextureBindFlags_ {\r
+ ovrTextureBind_None,\r
+\r
+ /// The application can write into the chain with pixel shader.\r
+ ovrTextureBind_DX_RenderTarget = 0x0001,\r
+\r
+ /// The application can write to the chain with compute shader.\r
+ ovrTextureBind_DX_UnorderedAccess = 0x0002,\r
+\r
+ /// The chain buffers can be bound as depth and/or stencil buffers.\r
+ /// This flag cannot be combined with ovrTextureBind_DX_RenderTarget.\r
+ ovrTextureBind_DX_DepthStencil = 0x0004,\r
+\r
+ ovrTextureBind_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrTextureBindFlags;\r
+\r
+/// The format of a texture.\r
+///\r
+/// \see ovrTextureSwapChainDesc\r
+///\r
+typedef enum ovrTextureFormat_ {\r
+ OVR_FORMAT_UNKNOWN = 0,\r
+ OVR_FORMAT_B5G6R5_UNORM = 1, ///< Not currently supported on PC. Requires a DirectX 11.1 device.\r
+ OVR_FORMAT_B5G5R5A1_UNORM = 2, ///< Not currently supported on PC. Requires a DirectX 11.1 device.\r
+ OVR_FORMAT_B4G4R4A4_UNORM = 3, ///< Not currently supported on PC. Requires a DirectX 11.1 device.\r
+ OVR_FORMAT_R8G8B8A8_UNORM = 4,\r
+ OVR_FORMAT_R8G8B8A8_UNORM_SRGB = 5,\r
+ OVR_FORMAT_B8G8R8A8_UNORM = 6,\r
+ OVR_FORMAT_B8G8R8_UNORM = 27,\r
+ OVR_FORMAT_B8G8R8A8_UNORM_SRGB = 7, ///< Not supported for OpenGL applications\r
+ OVR_FORMAT_B8G8R8X8_UNORM = 8, ///< Not supported for OpenGL applications\r
+ OVR_FORMAT_B8G8R8X8_UNORM_SRGB = 9, ///< Not supported for OpenGL applications\r
+ OVR_FORMAT_R16G16B16A16_FLOAT = 10,\r
+ OVR_FORMAT_R11G11B10_FLOAT = 25, ///< Introduced in v1.10\r
+\r
+ // Depth formats\r
+ OVR_FORMAT_D16_UNORM = 11,\r
+ OVR_FORMAT_D24_UNORM_S8_UINT = 12,\r
+ OVR_FORMAT_D32_FLOAT = 13,\r
+ OVR_FORMAT_D32_FLOAT_S8X24_UINT = 14,\r
+\r
+ // Added in 1.5 compressed formats can be used for static layers\r
+ OVR_FORMAT_BC1_UNORM = 15,\r
+ OVR_FORMAT_BC1_UNORM_SRGB = 16,\r
+ OVR_FORMAT_BC2_UNORM = 17,\r
+ OVR_FORMAT_BC2_UNORM_SRGB = 18,\r
+ OVR_FORMAT_BC3_UNORM = 19,\r
+ OVR_FORMAT_BC3_UNORM_SRGB = 20,\r
+ OVR_FORMAT_BC6H_UF16 = 21,\r
+ OVR_FORMAT_BC6H_SF16 = 22,\r
+ OVR_FORMAT_BC7_UNORM = 23,\r
+ OVR_FORMAT_BC7_UNORM_SRGB = 24,\r
+\r
+\r
+ OVR_FORMAT_ENUMSIZE = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrTextureFormat;\r
+\r
+/// Misc flags overriding particular\r
+/// behaviors of a texture swap chain\r
+///\r
+/// \see ovrTextureSwapChainDesc\r
+///\r
+typedef enum ovrTextureMiscFlags_ {\r
+ ovrTextureMisc_None,\r
+\r
+ /// Vulkan and DX only: The underlying texture is created with a TYPELESS equivalent\r
+ /// of the format specified in the texture desc. The SDK will still access the\r
+ /// texture using the format specified in the texture desc, but the app can\r
+ /// create views with different formats if this is specified.\r
+ ovrTextureMisc_DX_Typeless = 0x0001,\r
+\r
+ /// DX only: Allow generation of the mip chain on the GPU via the GenerateMips\r
+ /// call. This flag requires that RenderTarget binding also be specified.\r
+ ovrTextureMisc_AllowGenerateMips = 0x0002,\r
+\r
+ /// Texture swap chain contains protected content, and requires\r
+ /// HDCP connection in order to display to HMD. Also prevents\r
+ /// mirroring or other redirection of any frame containing this contents\r
+ ovrTextureMisc_ProtectedContent = 0x0004,\r
+\r
+ /// Automatically generate and use the mip chain in composition on each submission.\r
+ /// Mips are regenerated from highest quality level, ignoring other pre-existing mip levels.\r
+ /// Not supported for depth or compressed (BC) formats.\r
+ ovrTextureMisc_AutoGenerateMips = 0x0008,\r
+\r
+ ovrTextureMisc_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrTextureFlags;\r
+\r
+/// Description used to create a texture swap chain.\r
+///\r
+/// \see ovr_CreateTextureSwapChainDX\r
+/// \see ovr_CreateTextureSwapChainGL\r
+///\r
+typedef struct ovrTextureSwapChainDesc_ {\r
+ ovrTextureType Type; ///< Must not be ovrTexture_Window\r
+ ovrTextureFormat Format;\r
+ int ArraySize; ///< Must be 6 for ovrTexture_Cube, 1 for other types.\r
+ int Width;\r
+ int Height;\r
+ int MipLevels;\r
+ int SampleCount;\r
+ ovrBool StaticImage; ///< Not buffered in a chain. For images that don't change\r
+ OVR_ALIGNAS(4) unsigned int MiscFlags; ///< ovrTextureFlags\r
+ OVR_ALIGNAS(4) unsigned int BindFlags; ///< ovrTextureBindFlags. Not used for GL.\r
+} ovrTextureSwapChainDesc;\r
+\r
+/// Bit flags used as part of ovrMirrorTextureDesc's MirrorOptions field.\r
+///\r
+/// \see ovr_CreateMirrorTextureWithOptionsDX\r
+/// \see ovr_CreateMirrorTextureWithOptionsGL\r
+/// \see ovr_CreateMirrorTextureWithOptionsVk\r
+///\r
+typedef enum ovrMirrorOptions_ {\r
+ /// By default the mirror texture will be:\r
+ /// * Pre-distortion (i.e. rectilinear)\r
+ /// * Contain both eye textures\r
+ /// * Exclude Guardian, Notifications, System Menu GUI\r
+ ovrMirrorOption_Default = 0x0000,\r
+\r
+ /// Retrieves the barrel distorted texture contents instead of the rectilinear one\r
+ /// This is only recommended for debugging purposes, and not for final desktop presentation\r
+ ovrMirrorOption_PostDistortion = 0x0001,\r
+\r
+ /// Since ovrMirrorOption_Default renders both eyes into the mirror texture,\r
+ /// these two flags are exclusive (i.e. cannot use them simultaneously)\r
+ ovrMirrorOption_LeftEyeOnly = 0x0002,\r
+ ovrMirrorOption_RightEyeOnly = 0x0004,\r
+\r
+ /// Shows the boundary system aka Guardian on the mirror texture\r
+ ovrMirrorOption_IncludeGuardian = 0x0008,\r
+\r
+ /// Shows system notifications the user receives on the mirror texture\r
+ ovrMirrorOption_IncludeNotifications = 0x0010,\r
+\r
+ /// Shows the system menu (triggered by hitting the Home button) on the mirror texture\r
+ ovrMirrorOption_IncludeSystemGui = 0x0020,\r
+\r
+\r
+ ovrMirrorOption_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrMirrorOptions;\r
+\r
+/// Description used to create a mirror texture.\r
+///\r
+/// \see ovr_CreateMirrorTextureWithOptionsDX\r
+/// \see ovr_CreateMirrorTextureWithOptionsGL\r
+/// \see ovr_CreateMirrorTextureWithOptionsVk\r
+///\r
+typedef struct ovrMirrorTextureDesc_ {\r
+ ovrTextureFormat Format;\r
+ int Width;\r
+ int Height;\r
+ unsigned int MiscFlags; ///< ovrTextureFlags\r
+ unsigned int MirrorOptions; ///< ovrMirrorOptions\r
+} ovrMirrorTextureDesc;\r
+\r
+typedef struct ovrTextureSwapChainData* ovrTextureSwapChain;\r
+typedef struct ovrMirrorTextureData* ovrMirrorTexture;\r
+\r
+//-----------------------------------------------------------------------------------\r
+\r
+/// Describes button input types.\r
+/// Button inputs are combined; that is they will be reported as pressed if they are\r
+/// pressed on either one of the two devices.\r
+/// The ovrButton_Up/Down/Left/Right map to both XBox D-Pad and directional buttons.\r
+/// The ovrButton_Enter and ovrButton_Return map to Start and Back controller buttons, respectively.\r
+typedef enum ovrButton_ {\r
+ /// A button on XBox controllers and right Touch controller. Select button on Oculus Remote.\r
+ ovrButton_A = 0x00000001,\r
+\r
+ /// B button on XBox controllers and right Touch controller. Back button on Oculus Remote.\r
+ ovrButton_B = 0x00000002,\r
+\r
+ /// Right thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.\r
+ ovrButton_RThumb = 0x00000004,\r
+\r
+ /// Right shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.\r
+ ovrButton_RShoulder = 0x00000008,\r
+\r
+\r
+ /// X button on XBox controllers and left Touch controller. Not present on Oculus Remote.\r
+ ovrButton_X = 0x00000100,\r
+\r
+ /// Y button on XBox controllers and left Touch controller. Not present on Oculus Remote.\r
+ ovrButton_Y = 0x00000200,\r
+\r
+ /// Left thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.\r
+ ovrButton_LThumb = 0x00000400,\r
+\r
+ /// Left shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.\r
+ ovrButton_LShoulder = 0x00000800,\r
+\r
+ /// Up button on XBox controllers and Oculus Remote. Not present on Touch controllers.\r
+ ovrButton_Up = 0x00010000,\r
+\r
+ /// Down button on XBox controllers and Oculus Remote. Not present on Touch controllers.\r
+ ovrButton_Down = 0x00020000,\r
+\r
+ /// Left button on XBox controllers and Oculus Remote. Not present on Touch controllers.\r
+ ovrButton_Left = 0x00040000,\r
+\r
+ /// Right button on XBox controllers and Oculus Remote. Not present on Touch controllers.\r
+ ovrButton_Right = 0x00080000,\r
+\r
+ /// Start on XBox 360 controller. Menu on XBox One controller and Left Touch controller.\r
+ /// Should be referred to as the Menu button in user-facing documentation.\r
+ ovrButton_Enter = 0x00100000,\r
+\r
+ /// Back on Xbox 360 controller. View button on XBox One controller. Not present on Touch\r
+ /// controllers or Oculus Remote.\r
+ ovrButton_Back = 0x00200000,\r
+\r
+ /// Volume button on Oculus Remote. Not present on XBox or Touch controllers.\r
+ ovrButton_VolUp = 0x00400000,\r
+\r
+ /// Volume button on Oculus Remote. Not present on XBox or Touch controllers.\r
+ ovrButton_VolDown = 0x00800000,\r
+\r
+ /// Home button on XBox controllers. Oculus button on Touch controllers and Oculus Remote.\r
+ ovrButton_Home = 0x01000000,\r
+\r
+ // Bit mask of all buttons that are for private usage by Oculus\r
+ ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home,\r
+\r
+ // Bit mask of all buttons on the right Touch controller\r
+ ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder,\r
+\r
+ // Bit mask of all buttons on the left Touch controller\r
+ ovrButton_LMask =\r
+ ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder | ovrButton_Enter,\r
+\r
+ ovrButton_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrButton;\r
+\r
+/// Describes touch input types.\r
+/// These values map to capacitive touch values reported ovrInputState::Touch.\r
+/// Some of these values are mapped to button bits for consistency.\r
+typedef enum ovrTouch_ {\r
+ ovrTouch_A = ovrButton_A,\r
+ ovrTouch_B = ovrButton_B,\r
+ ovrTouch_RThumb = ovrButton_RThumb,\r
+ ovrTouch_RThumbRest = 0x00000008,\r
+ ovrTouch_RIndexTrigger = 0x00000010,\r
+\r
+ // Bit mask of all the button touches on the right controller\r
+ ovrTouch_RButtonMask =\r
+ ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RThumbRest | ovrTouch_RIndexTrigger,\r
+\r
+ ovrTouch_X = ovrButton_X,\r
+ ovrTouch_Y = ovrButton_Y,\r
+ ovrTouch_LThumb = ovrButton_LThumb,\r
+ ovrTouch_LThumbRest = 0x00000800,\r
+ ovrTouch_LIndexTrigger = 0x00001000,\r
+\r
+ // Bit mask of all the button touches on the left controller\r
+ ovrTouch_LButtonMask =\r
+ ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger,\r
+\r
+ // Finger pose state\r
+ // Derived internally based on distance, proximity to sensors and filtering.\r
+ ovrTouch_RIndexPointing = 0x00000020,\r
+ ovrTouch_RThumbUp = 0x00000040,\r
+ ovrTouch_LIndexPointing = 0x00002000,\r
+ ovrTouch_LThumbUp = 0x00004000,\r
+\r
+ // Bit mask of all right controller poses\r
+ ovrTouch_RPoseMask = ovrTouch_RIndexPointing | ovrTouch_RThumbUp,\r
+\r
+ // Bit mask of all left controller poses\r
+ ovrTouch_LPoseMask = ovrTouch_LIndexPointing | ovrTouch_LThumbUp,\r
+\r
+ ovrTouch_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrTouch;\r
+\r
+/// Describes the Touch Haptics engine.\r
+/// Currently, those values will NOT change during a session.\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTouchHapticsDesc_ {\r
+ // Haptics engine frequency/sample-rate, sample time in seconds equals 1.0/sampleRateHz\r
+ int SampleRateHz;\r
+ // Size of each Haptics sample, sample value range is [0, 2^(Bytes*8)-1]\r
+ int SampleSizeInBytes;\r
+\r
+ // Queue size that would guarantee Haptics engine would not starve for data\r
+ // Make sure size doesn't drop below it for best results\r
+ int QueueMinSizeToAvoidStarvation;\r
+\r
+ // Minimum, Maximum and Optimal number of samples that can be sent to Haptics through\r
+ // ovr_SubmitControllerVibration\r
+ int SubmitMinSamples;\r
+ int SubmitMaxSamples;\r
+ int SubmitOptimalSamples;\r
+} ovrTouchHapticsDesc;\r
+\r
+/// Specifies which controller is connected; multiple can be connected at once.\r
+typedef enum ovrControllerType_ {\r
+ ovrControllerType_None = 0x0000,\r
+ ovrControllerType_LTouch = 0x0001,\r
+ ovrControllerType_RTouch = 0x0002,\r
+ ovrControllerType_Touch = (ovrControllerType_LTouch | ovrControllerType_RTouch),\r
+ ovrControllerType_Remote = 0x0004,\r
+\r
+ ovrControllerType_XBox = 0x0010,\r
+\r
+ ovrControllerType_Object0 = 0x0100,\r
+ ovrControllerType_Object1 = 0x0200,\r
+ ovrControllerType_Object2 = 0x0400,\r
+ ovrControllerType_Object3 = 0x0800,\r
+\r
+ ovrControllerType_Active = 0xffffffff, ///< Operate on or query whichever controller is active.\r
+\r
+ ovrControllerType_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrControllerType;\r
+\r
+/// Haptics buffer submit mode\r
+typedef enum ovrHapticsBufferSubmitMode_ {\r
+ /// Enqueue buffer for later playback\r
+ ovrHapticsBufferSubmit_Enqueue\r
+} ovrHapticsBufferSubmitMode;\r
+\r
+/// Maximum number of samples in ovrHapticsBuffer\r
+#define OVR_HAPTICS_BUFFER_SAMPLES_MAX 256\r
+\r
+/// Haptics buffer descriptor, contains amplitude samples used for Touch vibration\r
+typedef struct ovrHapticsBuffer_ {\r
+ /// Samples stored in opaque format\r
+ const void* Samples;\r
+ /// Number of samples (up to OVR_HAPTICS_BUFFER_SAMPLES_MAX)\r
+ int SamplesCount;\r
+ /// How samples are submitted to the hardware\r
+ ovrHapticsBufferSubmitMode SubmitMode;\r
+} ovrHapticsBuffer;\r
+\r
+/// State of the Haptics playback for Touch vibration\r
+typedef struct ovrHapticsPlaybackState_ {\r
+ // Remaining space available to queue more samples\r
+ int RemainingQueueSpace;\r
+\r
+ // Number of samples currently queued\r
+ int SamplesQueued;\r
+} ovrHapticsPlaybackState;\r
+\r
+/// Position tracked devices\r
+typedef enum ovrTrackedDeviceType_ {\r
+ ovrTrackedDevice_None = 0x0000,\r
+ ovrTrackedDevice_HMD = 0x0001,\r
+ ovrTrackedDevice_LTouch = 0x0002,\r
+ ovrTrackedDevice_RTouch = 0x0004,\r
+ ovrTrackedDevice_Touch = (ovrTrackedDevice_LTouch | ovrTrackedDevice_RTouch),\r
+\r
+ ovrTrackedDevice_Object0 = 0x0010,\r
+ ovrTrackedDevice_Object1 = 0x0020,\r
+ ovrTrackedDevice_Object2 = 0x0040,\r
+ ovrTrackedDevice_Object3 = 0x0080,\r
+\r
+ ovrTrackedDevice_All = 0xFFFF,\r
+} ovrTrackedDeviceType;\r
+\r
+/// Boundary types that specified while using the boundary system\r
+typedef enum ovrBoundaryType_ {\r
+ /// Outer boundary - closely represents user setup walls\r
+ ovrBoundary_Outer = 0x0001,\r
+\r
+ /// Play area - safe rectangular area inside outer boundary which can optionally be used to\r
+ /// restrict user interactions and motion.\r
+ ovrBoundary_PlayArea = 0x0100,\r
+} ovrBoundaryType;\r
+\r
+/// Boundary system look and feel\r
+typedef struct ovrBoundaryLookAndFeel_ {\r
+ /// Boundary color (alpha channel is ignored)\r
+ ovrColorf Color;\r
+} ovrBoundaryLookAndFeel;\r
+\r
+/// Provides boundary test information\r
+typedef struct ovrBoundaryTestResult_ {\r
+ /// True if the boundary system is being triggered. Note that due to fade in/out effects this may\r
+ /// not exactly match visibility.\r
+ ovrBool IsTriggering;\r
+\r
+ /// Distance to the closest play area or outer boundary surface.\r
+ float ClosestDistance;\r
+\r
+ /// Closest point on the boundary surface.\r
+ ovrVector3f ClosestPoint;\r
+\r
+ /// Unit surface normal of the closest boundary surface.\r
+ ovrVector3f ClosestPointNormal;\r
+} ovrBoundaryTestResult;\r
+\r
+/// Provides names for the left and right hand array indexes.\r
+///\r
+/// \see ovrInputState, ovrTrackingState\r
+///\r
+typedef enum ovrHandType_ {\r
+ ovrHand_Left = 0,\r
+ ovrHand_Right = 1,\r
+ ovrHand_Count = 2,\r
+ ovrHand_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrHandType;\r
+\r
+/// ovrInputState describes the complete controller input state, including Oculus Touch,\r
+/// and XBox gamepad. If multiple inputs are connected and used at the same time,\r
+/// their inputs are combined.\r
+typedef struct ovrInputState_ {\r
+ /// System type when the controller state was last updated.\r
+ double TimeInSeconds;\r
+\r
+ /// Values for buttons described by ovrButton.\r
+ unsigned int Buttons;\r
+\r
+ /// Touch values for buttons and sensors as described by ovrTouch.\r
+ unsigned int Touches;\r
+\r
+ /// Left and right finger trigger values (ovrHand_Left and ovrHand_Right), in range 0.0 to 1.0f.\r
+ /// Returns 0 if the value would otherwise be less than 0.1176, for ovrControllerType_XBox.\r
+ /// This has been formally named simply "Trigger". We retain the name IndexTrigger for backwards\r
+ /// code compatibility.\r
+ /// User-facing documentation should refer to it as the Trigger.\r
+ float IndexTrigger[ovrHand_Count];\r
+\r
+ /// Left and right hand trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f.\r
+ /// This has been formally named "Grip Button". We retain the name HandTrigger for backwards code\r
+ /// compatibility.\r
+ /// User-facing documentation should refer to it as the Grip Button or simply Grip.\r
+ float HandTrigger[ovrHand_Count];\r
+\r
+ /// Horizontal and vertical thumbstick axis values (ovrHand_Left and ovrHand_Right), in the range\r
+ /// of -1.0f to 1.0f.\r
+ /// Returns a deadzone (value 0) per each axis if the value on that axis would otherwise have been\r
+ /// between -.2746 to +.2746, for ovrControllerType_XBox\r
+ ovrVector2f Thumbstick[ovrHand_Count];\r
+\r
+ /// The type of the controller this state is for.\r
+ ovrControllerType ControllerType;\r
+\r
+ /// Left and right finger trigger values (ovrHand_Left and ovrHand_Right), in range 0.0 to 1.0f.\r
+ /// Does not apply a deadzone. Only touch applies a filter.\r
+ /// This has been formally named simply "Trigger". We retain the name IndexTrigger for backwards\r
+ /// code compatibility.\r
+ /// User-facing documentation should refer to it as the Trigger.\r
+ float IndexTriggerNoDeadzone[ovrHand_Count];\r
+\r
+ /// Left and right hand trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f.\r
+ /// Does not apply a deadzone. Only touch applies a filter.\r
+ /// This has been formally named "Grip Button". We retain the name HandTrigger for backwards code\r
+ /// compatibility.\r
+ /// User-facing documentation should refer to it as the Grip Button or simply Grip.\r
+ float HandTriggerNoDeadzone[ovrHand_Count];\r
+\r
+ /// Horizontal and vertical thumbstick axis values (ovrHand_Left and ovrHand_Right), in the range\r
+ /// -1.0f to 1.0f\r
+ /// Does not apply a deadzone or filter.\r
+ ovrVector2f ThumbstickNoDeadzone[ovrHand_Count];\r
+\r
+ /// Left and right finger trigger values (ovrHand_Left and ovrHand_Right), in range 0.0 to 1.0f.\r
+ /// No deadzone or filter\r
+ /// This has been formally named "Grip Button". We retain the name HandTrigger for backwards code\r
+ /// compatibility.\r
+ /// User-facing documentation should refer to it as the Grip Button or simply Grip.\r
+ float IndexTriggerRaw[ovrHand_Count];\r
+\r
+ /// Left and right hand trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f.\r
+ /// No deadzone or filter\r
+ /// This has been formally named "Grip Button". We retain the name HandTrigger for backwards code\r
+ /// compatibility.\r
+ /// User-facing documentation should refer to it as the Grip Button or simply Grip.\r
+ float HandTriggerRaw[ovrHand_Count];\r
+\r
+ /// Horizontal and vertical thumbstick axis values (ovrHand_Left and ovrHand_Right), in the range\r
+ /// -1.0f to 1.0f\r
+ /// No deadzone or filter\r
+ ovrVector2f ThumbstickRaw[ovrHand_Count];\r
+} ovrInputState;\r
+\r
+typedef struct ovrCameraIntrinsics_ {\r
+ /// Time in seconds from last change to the parameters\r
+ double LastChangedTime;\r
+\r
+ /// Angles of all 4 sides of viewport\r
+ ovrFovPort FOVPort;\r
+\r
+ /// Near plane of the virtual camera used to match the external camera\r
+ float VirtualNearPlaneDistanceMeters;\r
+\r
+ /// Far plane of the virtual camera used to match the external camera\r
+ float VirtualFarPlaneDistanceMeters;\r
+\r
+ /// Height in pixels of image sensor\r
+ ovrSizei ImageSensorPixelResolution;\r
+\r
+ /// The lens distortion matrix of camera\r
+ ovrMatrix4f LensDistortionMatrix;\r
+\r
+ /// How often, in seconds, the exposure is taken\r
+ double ExposurePeriodSeconds;\r
+\r
+ /// length of the exposure time\r
+ double ExposureDurationSeconds;\r
+\r
+} ovrCameraIntrinsics;\r
+\r
+typedef enum ovrCameraStatusFlags_ {\r
+ /// Initial state of camera\r
+ ovrCameraStatus_None = 0x0,\r
+\r
+ /// Bit set when the camera is connected to the system\r
+ ovrCameraStatus_Connected = 0x1,\r
+\r
+ /// Bit set when the camera is undergoing calibration\r
+ ovrCameraStatus_Calibrating = 0x2,\r
+\r
+ /// Bit set when the camera has tried & failed calibration\r
+ ovrCameraStatus_CalibrationFailed = 0x4,\r
+\r
+ /// Bit set when the camera has tried & passed calibration\r
+ ovrCameraStatus_Calibrated = 0x8,\r
+\r
+ /// Bit set when the camera is capturing\r
+ ovrCameraStatus_Capturing = 0x10,\r
+\r
+ ovrCameraStatus_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrCameraStatusFlags;\r
+\r
+typedef struct ovrCameraExtrinsics_ {\r
+ /// Time in seconds from last change to the parameters.\r
+ /// For instance, if the pose changes, or a camera exposure happens, this struct will be updated.\r
+ double LastChangedTimeSeconds;\r
+\r
+ /// Current Status of the camera, a mix of bits from ovrCameraStatusFlags\r
+ unsigned int CameraStatusFlags;\r
+\r
+ /// Which Tracked device, if any, is the camera rigidly attached to\r
+ /// If set to ovrTrackedDevice_None, then the camera is not attached to a tracked object.\r
+ /// If the external camera moves while unattached (i.e. set to ovrTrackedDevice_None), its Pose\r
+ /// won't be updated\r
+ ovrTrackedDeviceType AttachedToDevice;\r
+\r
+ /// The relative Pose of the External Camera.\r
+ /// If AttachedToDevice is ovrTrackedDevice_None, then this is a absolute pose in tracking space\r
+ ovrPosef RelativePose;\r
+\r
+ /// The time, in seconds, when the last successful exposure was taken\r
+ double LastExposureTimeSeconds;\r
+\r
+ /// Estimated exposure latency to get from the exposure time to the system\r
+ double ExposureLatencySeconds;\r
+\r
+ /// Additional latency to get from the exposure time of the real camera to match the render time\r
+ /// of the virtual camera\r
+ double AdditionalLatencySeconds;\r
+\r
+} ovrCameraExtrinsics;\r
+#define OVR_MAX_EXTERNAL_CAMERA_COUNT 16\r
+#define OVR_EXTERNAL_CAMERA_NAME_SIZE 32\r
+typedef struct ovrExternalCamera_ {\r
+ char Name[OVR_EXTERNAL_CAMERA_NAME_SIZE]; // camera identifier: vid + pid + serial number etc.\r
+ ovrCameraIntrinsics Intrinsics;\r
+ ovrCameraExtrinsics Extrinsics;\r
+} ovrExternalCamera;\r
+\r
+//-----------------------------------------------------------------------------------\r
+// ***** Initialize structures\r
+\r
+/// Initialization flags.\r
+///\r
+/// \see ovrInitParams, ovr_Initialize\r
+///\r
+typedef enum ovrInitFlags_ {\r
+ /// When a debug library is requested, a slower debugging version of the library will\r
+ /// run which can be used to help solve problems in the library and debug application code.\r
+ ovrInit_Debug = 0x00000001,\r
+\r
+\r
+ /// When a version is requested, the LibOVR runtime respects the RequestedMinorVersion\r
+ /// field and verifies that the RequestedMinorVersion is supported. Normally when you\r
+ /// specify this flag you simply use OVR_MINOR_VERSION for ovrInitParams::RequestedMinorVersion,\r
+ /// though you could use a lower version than OVR_MINOR_VERSION to specify previous\r
+ /// version behavior.\r
+ ovrInit_RequestVersion = 0x00000004,\r
+\r
+\r
+ /// This client will not be visible in the HMD.\r
+ /// Typically set by diagnostic or debugging utilities.\r
+ ovrInit_Invisible = 0x00000010,\r
+\r
+ /// This client will alternate between VR and 2D rendering.\r
+ /// Typically set by game engine editors and VR-enabled web browsers.\r
+ ovrInit_MixedRendering = 0x00000020,\r
+\r
+ /// This client is aware of ovrSessionStatus focus states (e.g. ovrSessionStatus::HasInputFocus),\r
+ /// and responds to them appropriately (e.g. pauses and stops drawing hands when lacking focus).\r
+ ovrInit_FocusAware = 0x00000040,\r
+\r
+\r
+\r
+\r
+\r
+ /// These bits are writable by user code.\r
+ ovrinit_WritableBits = 0x00ffffff,\r
+\r
+ ovrInit_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrInitFlags;\r
+\r
+/// Logging levels\r
+///\r
+/// \see ovrInitParams, ovrLogCallback\r
+///\r
+typedef enum ovrLogLevel_ {\r
+ ovrLogLevel_Debug = 0, ///< Debug-level log event.\r
+ ovrLogLevel_Info = 1, ///< Info-level log event.\r
+ ovrLogLevel_Error = 2, ///< Error-level log event.\r
+\r
+ ovrLogLevel_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrLogLevel;\r
+\r
+/// Signature of the logging callback function pointer type.\r
+///\r
+/// \param[in] userData is an arbitrary value specified by the user of ovrInitParams.\r
+/// \param[in] level is one of the ovrLogLevel constants.\r
+/// \param[in] message is a UTF8-encoded null-terminated string.\r
+/// \see ovrInitParams, ovrLogLevel, ovr_Initialize\r
+///\r
+typedef void(OVR_CDECL* ovrLogCallback)(uintptr_t userData, int level, const char* message);\r
+\r
+/// Parameters for ovr_Initialize.\r
+///\r
+/// \see ovr_Initialize\r
+///\r
+typedef struct OVR_ALIGNAS(8) ovrInitParams_ {\r
+ /// Flags from ovrInitFlags to override default behavior.\r
+ /// Use 0 for the defaults.\r
+ uint32_t Flags;\r
+\r
+ /// Requests a specific minor version of the LibOVR runtime.\r
+ /// Flags must include ovrInit_RequestVersion or this will be ignored and OVR_MINOR_VERSION\r
+ /// will be used. If you are directly calling the LibOVRRT version of ovr_Initialize\r
+ /// in the LibOVRRT DLL then this must be valid and include ovrInit_RequestVersion.\r
+ uint32_t RequestedMinorVersion;\r
+\r
+ /// User-supplied log callback function, which may be called at any time\r
+ /// asynchronously from multiple threads until ovr_Shutdown completes.\r
+ /// Use NULL to specify no log callback.\r
+ ovrLogCallback LogCallback;\r
+\r
+ /// User-supplied data which is passed as-is to LogCallback. Typically this\r
+ /// is used to store an application-specific pointer which is read in the\r
+ /// callback function.\r
+ uintptr_t UserData;\r
+\r
+ /// Relative number of milliseconds to wait for a connection to the server\r
+ /// before failing. Use 0 for the default timeout.\r
+ uint32_t ConnectionTimeoutMS;\r
+\r
+ OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad0, 4)) ///< \internal\r
+\r
+} ovrInitParams;\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#if !defined(OVR_EXPORTING_CAPI)\r
+\r
+// -----------------------------------------------------------------------------------\r
+// ***** API Interfaces\r
+\r
+/// Initializes LibOVR\r
+///\r
+/// Initialize LibOVR for application usage. This includes finding and loading the LibOVRRT\r
+/// shared library. No LibOVR API functions, other than ovr_GetLastErrorInfo and ovr_Detect, can\r
+/// be called unless ovr_Initialize succeeds. A successful call to ovr_Initialize must be eventually\r
+/// followed by a call to ovr_Shutdown. ovr_Initialize calls are idempotent.\r
+/// Calling ovr_Initialize twice does not require two matching calls to ovr_Shutdown.\r
+/// If already initialized, the return value is ovr_Success.\r
+///\r
+/// LibOVRRT shared library search order:\r
+/// -# Current working directory (often the same as the application directory).\r
+/// -# Module directory (usually the same as the application directory,\r
+/// but not if the module is a separate shared library).\r
+/// -# Application directory\r
+/// -# Development directory (only if OVR_ENABLE_DEVELOPER_SEARCH is enabled,\r
+/// which is off by default).\r
+/// -# Standard OS shared library search location(s) (OS-specific).\r
+///\r
+/// \param params Specifies custom initialization options. May be NULL to indicate default options\r
+/// when using the CAPI shim. If you are directly calling the LibOVRRT version of\r
+/// ovr_Initialize in the LibOVRRT DLL then this must be valid and\r
+/// include ovrInit_RequestVersion.\r
+/// \return Returns an ovrResult indicating success or failure. In the case of failure, use\r
+/// ovr_GetLastErrorInfo to get more information. Example failed results include:\r
+/// - ovrError_Initialize: Generic initialization error.\r
+/// - ovrError_LibLoad: Couldn't load LibOVRRT.\r
+/// - ovrError_LibVersion: LibOVRRT version incompatibility.\r
+/// - ovrError_ServiceConnection: Couldn't connect to the OVR Service.\r
+/// - ovrError_ServiceVersion: OVR Service version incompatibility.\r
+/// - ovrError_IncompatibleOS: The operating system version is incompatible.\r
+/// - ovrError_DisplayInit: Unable to initialize the HMD display.\r
+/// - ovrError_ServerStart: Unable to start the server. Is it already running?\r
+/// - ovrError_Reinitialization: Attempted to re-initialize with a different version.\r
+///\r
+/// <b>Example code</b>\r
+/// \code{.cpp}\r
+/// ovrInitParams initParams = { ovrInit_RequestVersion, OVR_MINOR_VERSION, NULL, 0, 0 };\r
+/// ovrResult result = ovr_Initialize(&initParams);\r
+/// if(OVR_FAILURE(result)) {\r
+/// ovrErrorInfo errorInfo;\r
+/// ovr_GetLastErrorInfo(&errorInfo);\r
+/// DebugLog("ovr_Initialize failed: %s", errorInfo.ErrorString);\r
+/// return false;\r
+/// }\r
+/// [...]\r
+/// \endcode\r
+///\r
+/// \see ovr_Shutdown\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_Initialize(const ovrInitParams* params);\r
+\r
+/// Shuts down LibOVR\r
+///\r
+/// A successful call to ovr_Initialize must be eventually matched by a call to ovr_Shutdown.\r
+/// After calling ovr_Shutdown, no LibOVR functions can be called except ovr_GetLastErrorInfo\r
+/// or another ovr_Initialize. ovr_Shutdown invalidates all pointers, references, and created\r
+/// objects\r
+/// previously returned by LibOVR functions. The LibOVRRT shared library can be unloaded by\r
+/// ovr_Shutdown.\r
+///\r
+/// \see ovr_Initialize\r
+///\r
+OVR_PUBLIC_FUNCTION(void) ovr_Shutdown();\r
+\r
+/// Returns information about the most recent failed return value by the\r
+/// current thread for this library.\r
+///\r
+/// This function itself can never generate an error.\r
+/// The last error is never cleared by LibOVR, but will be overwritten by new errors.\r
+/// Do not use this call to determine if there was an error in the last API\r
+/// call as successful API calls don't clear the last ovrErrorInfo.\r
+/// To avoid any inconsistency, ovr_GetLastErrorInfo should be called immediately\r
+/// after an API function that returned a failed ovrResult, with no other API\r
+/// functions called in the interim.\r
+///\r
+/// \param[out] errorInfo The last ovrErrorInfo for the current thread.\r
+///\r
+/// \see ovrErrorInfo\r
+///\r
+OVR_PUBLIC_FUNCTION(void) ovr_GetLastErrorInfo(ovrErrorInfo* errorInfo);\r
+\r
+/// Returns the version string representing the LibOVRRT version.\r
+///\r
+/// The returned string pointer is valid until the next call to ovr_Shutdown.\r
+///\r
+/// Note that the returned version string doesn't necessarily match the current\r
+/// OVR_MAJOR_VERSION, etc., as the returned string refers to the LibOVRRT shared\r
+/// library version and not the locally compiled interface version.\r
+///\r
+/// The format of this string is subject to change in future versions and its contents\r
+/// should not be interpreted.\r
+///\r
+/// \return Returns a UTF8-encoded null-terminated version string.\r
+///\r
+OVR_PUBLIC_FUNCTION(const char*) ovr_GetVersionString();\r
+\r
+/// Writes a message string to the LibOVR tracing mechanism (if enabled).\r
+///\r
+/// This message will be passed back to the application via the ovrLogCallback if\r
+/// it was registered.\r
+///\r
+/// \param[in] level One of the ovrLogLevel constants.\r
+/// \param[in] message A UTF8-encoded null-terminated string.\r
+/// \return returns the strlen of the message or a negative value if the message is too large.\r
+///\r
+/// \see ovrLogLevel, ovrLogCallback\r
+///\r
+OVR_PUBLIC_FUNCTION(int) ovr_TraceMessage(int level, const char* message);\r
+\r
+/// Identify client application info.\r
+///\r
+/// The string is one or more newline-delimited lines of optional info\r
+/// indicating engine name, engine version, engine plugin name, engine plugin\r
+/// version, engine editor. The order of the lines is not relevant. Individual\r
+/// lines are optional. A newline is not necessary at the end of the last line.\r
+/// Call after ovr_Initialize and before the first call to ovr_Create.\r
+/// Each value is limited to 20 characters. Key names such as 'EngineName:'\r
+/// 'EngineVersion:' do not count towards this limit.\r
+///\r
+/// \param[in] identity Specifies one or more newline-delimited lines of optional info:\r
+/// EngineName: %s\n\r
+/// EngineVersion: %s\n\r
+/// EnginePluginName: %s\n\r
+/// EnginePluginVersion: %s\n\r
+/// EngineEditor: <boolean> ('true' or 'false')\n\r
+///\r
+/// <b>Example code</b>\r
+/// \code{.cpp}\r
+/// ovr_IdentifyClient("EngineName: Unity\n"\r
+/// "EngineVersion: 5.3.3\n"\r
+/// "EnginePluginName: OVRPlugin\n"\r
+/// "EnginePluginVersion: 1.2.0\n"\r
+/// "EngineEditor: true");\r
+/// \endcode\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_IdentifyClient(const char* identity);\r
+\r
+//-------------------------------------------------------------------------------------\r
+/// @name HMD Management\r
+///\r
+/// Handles the enumeration, creation, destruction, and properties of an HMD (head-mounted display).\r
+///@{\r
+\r
+/// Returns information about the current HMD.\r
+///\r
+/// ovr_Initialize must be called prior to calling this function,\r
+/// otherwise ovrHmdDesc::Type will be set to ovrHmd_None without\r
+/// checking for the HMD presence.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create() or NULL.\r
+///\r
+/// \return Returns an ovrHmdDesc. If invoked with NULL session argument, ovrHmdDesc::Type\r
+/// set to ovrHmd_None indicates that the HMD is not connected.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrHmdDesc) ovr_GetHmdDesc(ovrSession session);\r
+\r
+/// Returns the number of attached trackers.\r
+///\r
+/// The number of trackers may change at any time, so this function should be called before use\r
+/// as opposed to once on startup.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+///\r
+/// \return Returns unsigned int count.\r
+///\r
+OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetTrackerCount(ovrSession session);\r
+\r
+/// Returns a given attached tracker description.\r
+///\r
+/// ovr_Initialize must have first been called in order for this to succeed, otherwise the returned\r
+/// trackerDescArray will be zero-initialized. The data returned by this function can change at\r
+/// runtime.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+///\r
+/// \param[in] trackerDescIndex Specifies a tracker index. The valid indexes are in the\r
+/// range of 0 to the tracker count returned by ovr_GetTrackerCount.\r
+///\r
+/// \return Returns ovrTrackerDesc. An empty ovrTrackerDesc will be returned if\r
+/// trackerDescIndex is out of range.\r
+///\r
+/// \see ovrTrackerDesc, ovr_GetTrackerCount\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrTrackerDesc)\r
+ovr_GetTrackerDesc(ovrSession session, unsigned int trackerDescIndex);\r
+\r
+/// Creates a handle to a VR session.\r
+///\r
+/// Upon success the returned ovrSession must be eventually freed with ovr_Destroy when it is no\r
+/// longer needed.\r
+/// A second call to ovr_Create will result in an error return value if the previous session has not\r
+/// been destroyed.\r
+///\r
+/// \param[out] pSession Provides a pointer to an ovrSession which will be written to upon success.\r
+/// \param[out] pLuid Provides a system specific graphics adapter identifier that locates which\r
+/// graphics adapter has the HMD attached. This must match the adapter used by the application\r
+/// or no rendering output will be possible. This is important for stability on multi-adapter\r
+/// systems. An\r
+/// application that simply chooses the default adapter will not run reliably on multi-adapter\r
+/// systems.\r
+/// \return Returns an ovrResult indicating success or failure. Upon failure\r
+/// the returned ovrSession will be NULL.\r
+///\r
+/// <b>Example code</b>\r
+/// \code{.cpp}\r
+/// ovrSession session;\r
+/// ovrGraphicsLuid luid;\r
+/// ovrResult result = ovr_Create(&session, &luid);\r
+/// if(OVR_FAILURE(result))\r
+/// ...\r
+/// \endcode\r
+///\r
+/// \see ovr_Destroy\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_Create(ovrSession* pSession, ovrGraphicsLuid* pLuid);\r
+\r
+/// Destroys the session.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \see ovr_Create\r
+///\r
+OVR_PUBLIC_FUNCTION(void) ovr_Destroy(ovrSession session);\r
+\r
+#endif // !defined(OVR_EXPORTING_CAPI)\r
+\r
+/// Specifies status information for the current session.\r
+///\r
+/// \see ovr_GetSessionStatus\r
+///\r
+typedef struct ovrSessionStatus_ {\r
+ /// True if the process has VR focus and thus is visible in the HMD.\r
+ ovrBool IsVisible;\r
+\r
+ /// True if an HMD is present.\r
+ ovrBool HmdPresent;\r
+\r
+ /// True if the HMD is on the user's head.\r
+ ovrBool HmdMounted;\r
+\r
+ /// True if the session is in a display-lost state. See ovr_SubmitFrame.\r
+ ovrBool DisplayLost;\r
+\r
+ /// True if the application should initiate shutdown.\r
+ ovrBool ShouldQuit;\r
+\r
+ /// True if UX has requested re-centering. Must call ovr_ClearShouldRecenterFlag,\r
+ /// ovr_RecenterTrackingOrigin or ovr_SpecifyTrackingOrigin.\r
+ ovrBool ShouldRecenter;\r
+\r
+ /// True if the application is the foreground application and receives input (e.g. Touch\r
+ /// controller state). If this is false then the application is in the background (but possibly\r
+ /// still visible) should hide any input representations such as hands.\r
+ ovrBool HasInputFocus;\r
+\r
+ /// True if a system overlay is present, such as a dashboard. In this case the application\r
+ /// (if visible) should pause while still drawing, avoid drawing near-field graphics so they\r
+ /// don't visually fight with the system overlay, and consume fewer CPU and GPU resources.\r
+ ovrBool OverlayPresent;\r
+\r
+ /// True if runtime is requesting that the application provide depth buffers with projection\r
+ /// layers.\r
+ ovrBool DepthRequested;\r
+\r
+} ovrSessionStatus;\r
+\r
+#if !defined(OVR_EXPORTING_CAPI)\r
+\r
+/// Returns status information for the application.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[out] sessionStatus Provides an ovrSessionStatus that is filled in.\r
+///\r
+/// \return Returns an ovrResult indicating success or failure. In the case of\r
+/// failure, use ovr_GetLastErrorInfo to get more information.\r
+/// Return values include but aren't limited to:\r
+/// - ovrSuccess: Completed successfully.\r
+/// - ovrError_ServiceConnection: The service connection was lost and the application\r
+/// must destroy the session.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetSessionStatus(ovrSession session, ovrSessionStatus* sessionStatus);\r
+\r
+\r
+/// Query extension support status.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] extension Extension to query.\r
+/// \param[out] outExtensionSupported Set to extension support status. ovrTrue if supported.\r
+///\r
+/// \return Returns an ovrResult indicating success or failure. In the case of\r
+/// failure use ovr_GetLastErrorInfo to get more information.\r
+///\r
+/// \see ovrExtensions\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_IsExtensionSupported(\r
+ ovrSession session,\r
+ ovrExtensions extension,\r
+ ovrBool* outExtensionSupported);\r
+\r
+/// Enable extension. Extensions must be enabled after ovr_Create is called.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] extension Extension to enable.\r
+///\r
+/// \return Returns an ovrResult indicating success or failure. Extension is only\r
+/// enabled if successful. In the case of failure use ovr_GetLastErrorInfo\r
+/// to get more information.\r
+///\r
+/// \see ovrExtensions\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_EnableExtension(ovrSession session, ovrExtensions extension);\r
+\r
+//@}\r
+\r
+//-------------------------------------------------------------------------------------\r
+/// @name Tracking\r
+///\r
+/// Tracking functions handle the position, orientation, and movement of the HMD in space.\r
+///\r
+/// All tracking interface functions are thread-safe, allowing tracking state to be sampled\r
+/// from different threads.\r
+///\r
+///@{\r
+\r
+\r
+/// Sets the tracking origin type\r
+///\r
+/// When the tracking origin is changed, all of the calls that either provide\r
+/// or accept ovrPosef will use the new tracking origin provided.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] origin Specifies an ovrTrackingOrigin to be used for all ovrPosef\r
+///\r
+/// \return Returns an ovrResult indicating success or failure. In the case of failure, use\r
+/// ovr_GetLastErrorInfo to get more information.\r
+///\r
+/// \see ovrTrackingOrigin, ovr_GetTrackingOriginType\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_SetTrackingOriginType(ovrSession session, ovrTrackingOrigin origin);\r
+\r
+/// Gets the tracking origin state\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+///\r
+/// \return Returns the ovrTrackingOrigin that was either set by default, or previous set by the\r
+/// application.\r
+///\r
+/// \see ovrTrackingOrigin, ovr_SetTrackingOriginType\r
+OVR_PUBLIC_FUNCTION(ovrTrackingOrigin) ovr_GetTrackingOriginType(ovrSession session);\r
+\r
+/// Re-centers the sensor position and orientation.\r
+///\r
+/// This resets the (x,y,z) positional components and the yaw orientation component of the\r
+/// tracking space for the HMD and controllers using the HMD's current tracking pose.\r
+/// If the caller requires some tweaks on top of the HMD's current tracking pose, consider using\r
+/// ovr_SpecifyTrackingOrigin instead.\r
+///\r
+/// The roll and pitch orientation components are always determined by gravity and cannot\r
+/// be redefined. All future tracking will report values relative to this new reference position.\r
+/// If you are using ovrTrackerPoses then you will need to call ovr_GetTrackerPose after\r
+/// this, because the sensor position(s) will change as a result of this.\r
+///\r
+/// The headset cannot be facing vertically upward or downward but rather must be roughly\r
+/// level otherwise this function will fail with ovrError_InvalidHeadsetOrientation.\r
+///\r
+/// For more info, see the notes on each ovrTrackingOrigin enumeration to understand how\r
+/// recenter will vary slightly in its behavior based on the current ovrTrackingOrigin setting.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+///\r
+/// \return Returns an ovrResult indicating success or failure. In the case of failure, use\r
+/// ovr_GetLastErrorInfo to get more information. Return values include but aren't limited\r
+/// to:\r
+/// - ovrSuccess: Completed successfully.\r
+/// - ovrError_InvalidHeadsetOrientation: The headset was facing an invalid direction when\r
+/// attempting recentering, such as facing vertically.\r
+///\r
+/// \see ovrTrackingOrigin, ovr_GetTrackerPose, ovr_SpecifyTrackingOrigin\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_RecenterTrackingOrigin(ovrSession session);\r
+\r
+/// Allows manually tweaking the sensor position and orientation.\r
+///\r
+/// This function is similar to ovr_RecenterTrackingOrigin in that it modifies the\r
+/// (x,y,z) positional components and the yaw orientation component of the tracking space for\r
+/// the HMD and controllers.\r
+///\r
+/// While ovr_RecenterTrackingOrigin resets the tracking origin in reference to the HMD's\r
+/// current pose, ovr_SpecifyTrackingOrigin allows the caller to explicitly specify a transform\r
+/// for the tracking origin. This transform is expected to be an offset to the most recent\r
+/// recentered origin, so calling this function repeatedly with the same originPose will keep\r
+/// nudging the recentered origin in that direction.\r
+///\r
+/// There are several use cases for this function. For example, if the application decides to\r
+/// limit the yaw, or translation of the recentered pose instead of directly using the HMD pose\r
+/// the application can query the current tracking state via ovr_GetTrackingState, and apply\r
+/// some limitations to the HMD pose because feeding this pose back into this function.\r
+/// Similarly, this can be used to "adjust the seating position" incrementally in apps that\r
+/// feature seated experiences such as cockpit-based games.\r
+///\r
+/// This function can emulate ovr_RecenterTrackingOrigin as such:\r
+/// ovrTrackingState ts = ovr_GetTrackingState(session, 0.0, ovrFalse);\r
+/// ovr_SpecifyTrackingOrigin(session, ts.HeadPose.ThePose);\r
+///\r
+/// The roll and pitch orientation components are determined by gravity and cannot be redefined.\r
+/// If you are using ovrTrackerPoses then you will need to call ovr_GetTrackerPose after\r
+/// this, because the sensor position(s) will change as a result of this.\r
+///\r
+/// For more info, see the notes on each ovrTrackingOrigin enumeration to understand how\r
+/// recenter will vary slightly in its behavior based on the current ovrTrackingOrigin setting.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] originPose Specifies a pose that will be used to transform the current tracking\r
+/// origin.\r
+///\r
+/// \return Returns an ovrResult indicating success or failure. In the case of failure, use\r
+/// ovr_GetLastErrorInfo to get more information. Return values include but aren't limited\r
+/// to:\r
+/// - ovrSuccess: Completed successfully.\r
+/// - ovrError_InvalidParameter: The heading direction in originPose was invalid,\r
+/// such as facing vertically. This can happen if the caller is directly feeding the pose\r
+/// of a position-tracked device such as an HMD or controller into this function.\r
+///\r
+/// \see ovrTrackingOrigin, ovr_GetTrackerPose, ovr_RecenterTrackingOrigin\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_SpecifyTrackingOrigin(ovrSession session, ovrPosef originPose);\r
+\r
+/// Clears the ShouldRecenter status bit in ovrSessionStatus.\r
+///\r
+/// Clears the ShouldRecenter status bit in ovrSessionStatus, allowing further recenter requests to\r
+/// be detected. Since this is automatically done by ovr_RecenterTrackingOrigin and\r
+/// ovr_SpecifyTrackingOrigin, this function only needs to be called when application is doing\r
+/// its own re-centering logic.\r
+OVR_PUBLIC_FUNCTION(void) ovr_ClearShouldRecenterFlag(ovrSession session);\r
+\r
+/// Returns tracking state reading based on the specified absolute system time.\r
+///\r
+/// Pass an absTime value of 0.0 to request the most recent sensor reading. In this case\r
+/// both PredictedPose and SamplePose will have the same value.\r
+///\r
+/// This may also be used for more refined timing of front buffer rendering logic, and so on.\r
+/// This may be called by multiple threads.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] absTime Specifies the absolute future time to predict the return\r
+/// ovrTrackingState value. Use 0 to request the most recent tracking state.\r
+/// \param[in] latencyMarker Specifies that this call is the point in time where\r
+/// the "App-to-Mid-Photon" latency timer starts from. If a given ovrLayer\r
+/// provides "SensorSampleTime", that will override the value stored here.\r
+/// \return Returns the ovrTrackingState that is predicted for the given absTime.\r
+///\r
+/// \see ovrTrackingState, ovr_GetEyePoses, ovr_GetTimeInSeconds\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrTrackingState)\r
+ovr_GetTrackingState(ovrSession session, double absTime, ovrBool latencyMarker);\r
+\r
+/// Returns an array of poses, where each pose matches a device type provided by the deviceTypes\r
+/// array parameter. If any pose cannot be retrieved, it will return a reason for the missing\r
+/// pose and the device pose will be zeroed out with a pose quaternion [x=0, y=0, z=0, w=1].\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] deviceTypes Array of device types to query for their poses.\r
+/// \param[in] deviceCount Number of queried poses. This number must match the length of the\r
+/// outDevicePoses and deviceTypes array.\r
+/// \param[in] absTime Specifies the absolute future time to predict the return\r
+/// ovrTrackingState value. Use 0 to request the most recent tracking state.\r
+/// \param[out] outDevicePoses Array of poses, one for each device type in deviceTypes arrays.\r
+///\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and\r
+/// true upon success.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetDevicePoses(\r
+ ovrSession session,\r
+ ovrTrackedDeviceType* deviceTypes,\r
+ int deviceCount,\r
+ double absTime,\r
+ ovrPoseStatef* outDevicePoses);\r
+\r
+\r
+/// Returns the ovrTrackerPose for the given attached tracker.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] trackerPoseIndex Index of the tracker being requested.\r
+///\r
+/// \return Returns the requested ovrTrackerPose. An empty ovrTrackerPose will be returned if\r
+/// trackerPoseIndex is out of range.\r
+///\r
+/// \see ovr_GetTrackerCount\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrTrackerPose)\r
+ovr_GetTrackerPose(ovrSession session, unsigned int trackerPoseIndex);\r
+\r
+/// Returns the most recent input state for controllers, without positional tracking info.\r
+///\r
+/// \param[out] inputState Input state that will be filled in.\r
+/// \param[in] ovrControllerType Specifies which controller the input will be returned for.\r
+/// \return Returns ovrSuccess if the new state was successfully obtained.\r
+///\r
+/// \see ovrControllerType\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetInputState(ovrSession session, ovrControllerType controllerType, ovrInputState* inputState);\r
+\r
+/// Returns controller types connected to the system OR'ed together.\r
+///\r
+/// \return A bitmask of ovrControllerTypes connected to the system.\r
+///\r
+/// \see ovrControllerType\r
+///\r
+OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetConnectedControllerTypes(ovrSession session);\r
+\r
+/// Gets information about Haptics engine for the specified Touch controller.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] controllerType The controller to retrieve the information from.\r
+///\r
+/// \return Returns an ovrTouchHapticsDesc.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrTouchHapticsDesc)\r
+ovr_GetTouchHapticsDesc(ovrSession session, ovrControllerType controllerType);\r
+\r
+/// Sets constant vibration (with specified frequency and amplitude) to a controller.\r
+/// Note: ovr_SetControllerVibration cannot be used interchangeably with\r
+/// ovr_SubmitControllerVibration.\r
+///\r
+/// This method should be called periodically, vibration lasts for a maximum of 2.5 seconds.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] controllerType The controller to set the vibration to.\r
+/// \param[in] frequency Vibration frequency. Supported values are: 0.0 (disabled), 0.5 and 1.0. Non\r
+/// valid values will be clamped.\r
+/// \param[in] amplitude Vibration amplitude in the [0.0, 1.0] range.\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: The call succeeded and a result was returned.\r
+/// - ovrSuccess_DeviceUnavailable: The call succeeded but the device referred to by\r
+/// controllerType is not available.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_SetControllerVibration(\r
+ ovrSession session,\r
+ ovrControllerType controllerType,\r
+ float frequency,\r
+ float amplitude);\r
+\r
+/// Submits a Haptics buffer (used for vibration) to Touch (only) controllers.\r
+/// Note: ovr_SubmitControllerVibration cannot be used interchangeably with\r
+/// ovr_SetControllerVibration.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] controllerType Controller where the Haptics buffer will be played.\r
+/// \param[in] buffer Haptics buffer containing amplitude samples to be played.\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: The call succeeded and a result was returned.\r
+/// - ovrSuccess_DeviceUnavailable: The call succeeded but the device referred to by\r
+/// controllerType is not available.\r
+///\r
+/// \see ovrHapticsBuffer\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_SubmitControllerVibration(\r
+ ovrSession session,\r
+ ovrControllerType controllerType,\r
+ const ovrHapticsBuffer* buffer);\r
+\r
+/// Gets the Haptics engine playback state of a specific Touch controller.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] controllerType Controller where the Haptics buffer wil be played.\r
+/// \param[in] outState State of the haptics engine.\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: The call succeeded and a result was returned.\r
+/// - ovrSuccess_DeviceUnavailable: The call succeeded but the device referred to by\r
+/// controllerType is not available.\r
+///\r
+/// \see ovrHapticsPlaybackState\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetControllerVibrationState(\r
+ ovrSession session,\r
+ ovrControllerType controllerType,\r
+ ovrHapticsPlaybackState* outState);\r
+\r
+/// Tests collision/proximity of position tracked devices (e.g. HMD and/or Touch) against the\r
+/// Boundary System.\r
+/// Note: this method is similar to ovr_BoundaryTestPoint but can be more precise as it may take\r
+/// into account device acceleration/momentum.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] deviceBitmask Bitmask of one or more tracked devices to test.\r
+/// \param[in] boundaryType Must be either ovrBoundary_Outer or ovrBoundary_PlayArea.\r
+/// \param[out] outTestResult Result of collision/proximity test, contains information such as\r
+/// distance and closest point.\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: The call succeeded and a result was returned.\r
+/// - ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due\r
+/// to not being set up.\r
+/// - ovrSuccess_DeviceUnavailable: The call succeeded but the device referred to by\r
+/// deviceBitmask is not available.\r
+///\r
+/// \see ovrBoundaryTestResult\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_TestBoundary(\r
+ ovrSession session,\r
+ ovrTrackedDeviceType deviceBitmask,\r
+ ovrBoundaryType boundaryType,\r
+ ovrBoundaryTestResult* outTestResult);\r
+\r
+/// Tests collision/proximity of a 3D point against the Boundary System.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] point 3D point to test.\r
+/// \param[in] singleBoundaryType Must be either ovrBoundary_Outer or ovrBoundary_PlayArea to test\r
+/// against\r
+/// \param[out] outTestResult Result of collision/proximity test, contains information such as\r
+/// distance and closest point.\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: The call succeeded and a result was returned.\r
+/// - ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due\r
+/// to not being set up.\r
+///\r
+/// \see ovrBoundaryTestResult\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_TestBoundaryPoint(\r
+ ovrSession session,\r
+ const ovrVector3f* point,\r
+ ovrBoundaryType singleBoundaryType,\r
+ ovrBoundaryTestResult* outTestResult);\r
+\r
+/// Sets the look and feel of the Boundary System.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] lookAndFeel Look and feel parameters.\r
+/// \return Returns ovrSuccess upon success.\r
+/// \see ovrBoundaryLookAndFeel\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_SetBoundaryLookAndFeel(ovrSession session, const ovrBoundaryLookAndFeel* lookAndFeel);\r
+\r
+/// Resets the look and feel of the Boundary System to its default state.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \return Returns ovrSuccess upon success.\r
+/// \see ovrBoundaryLookAndFeel\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_ResetBoundaryLookAndFeel(ovrSession session);\r
+\r
+/// Gets the geometry of the Boundary System's "play area" or "outer boundary" as 3D floor points.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] boundaryType Must be either ovrBoundary_Outer or ovrBoundary_PlayArea.\r
+/// \param[out] outFloorPoints Array of 3D points (in clockwise order) defining the boundary at\r
+/// floor height (can be NULL to retrieve only the number of points).\r
+/// \param[out] outFloorPointsCount Number of 3D points returned in the array.\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: The call succeeded and a result was returned.\r
+/// - ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due\r
+/// to not being set up.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetBoundaryGeometry(\r
+ ovrSession session,\r
+ ovrBoundaryType boundaryType,\r
+ ovrVector3f* outFloorPoints,\r
+ int* outFloorPointsCount);\r
+\r
+/// Gets the dimension of the Boundary System's "play area" or "outer boundary".\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] boundaryType Must be either ovrBoundary_Outer or ovrBoundary_PlayArea.\r
+/// \param[out] outDimensions Dimensions of the axis aligned bounding box that encloses the area in\r
+/// meters (width, height and length).\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: The call succeeded and a result was returned.\r
+/// - ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due\r
+/// to not being set up.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetBoundaryDimensions(\r
+ ovrSession session,\r
+ ovrBoundaryType boundaryType,\r
+ ovrVector3f* outDimensions);\r
+\r
+/// Returns if the boundary is currently visible.\r
+/// Note: visibility is false if the user has turned off boundaries, otherwise, it's true if\r
+/// the app has requested boundaries to be visible or if any tracked device is currently\r
+/// triggering it. This may not exactly match rendering due to fade-in and fade-out effects.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[out] outIsVisible ovrTrue, if the boundary is visible.\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: Result was successful and a result was returned.\r
+/// - ovrSuccess_BoundaryInvalid: The call succeeded but the result is not a valid boundary due\r
+/// to not being set up.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetBoundaryVisible(ovrSession session, ovrBool* outIsVisible);\r
+\r
+/// Requests boundary to be visible.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] visible forces the outer boundary to be visible. An application can't force it\r
+/// to be invisible, but can cancel its request by passing false.\r
+/// \return Returns ovrSuccess upon success.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_RequestBoundaryVisible(ovrSession session, ovrBool visible);\r
+\r
+// -----------------------------------------------------------------------------------\r
+/// @name Mixed reality capture support\r
+///\r
+/// Defines functions used for mixed reality capture / third person cameras.\r
+///\r
+\r
+/// Returns the number of camera properties of all cameras\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in out] cameras Pointer to the array. If null and the provided array capacity is\r
+/// sufficient, will return ovrError_NullArrayPointer.\r
+/// \param[in out] inoutCameraCount Supply the\r
+/// array capacity, will return the actual # of cameras defined. If *inoutCameraCount is too small,\r
+/// will return ovrError_InsufficientArraySize.\r
+/// \return Returns the list of external cameras the system knows about.\r
+/// Returns ovrError_NoExternalCameraInfo if there is not any eternal camera information.\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetExternalCameras(\r
+ ovrSession session,\r
+ ovrExternalCamera* cameras,\r
+ unsigned int* inoutCameraCount);\r
+\r
+/// Sets the camera intrinsics and/or extrinsics stored for the cameraName camera\r
+/// Names must be < 32 characters and null-terminated.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] name Specifies which camera to set the intrinsics or extrinsics for.\r
+/// The name must be at most OVR_EXTERNAL_CAMERA_NAME_SIZE - 1\r
+/// characters. Otherwise, ovrError_ExternalCameraNameWrongSize is returned.\r
+/// \param[in] intrinsics Contains the intrinsic parameters to set, can be null\r
+/// \param[in] extrinsics Contains the extrinsic parameters to set, can be null\r
+/// \return Returns ovrSuccess or an ovrError code\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_SetExternalCameraProperties(\r
+ ovrSession session,\r
+ const char* name,\r
+ const ovrCameraIntrinsics* const intrinsics,\r
+ const ovrCameraExtrinsics* const extrinsics);\r
+\r
+///@}\r
+\r
+#endif // !defined(OVR_EXPORTING_CAPI)\r
+\r
+//-------------------------------------------------------------------------------------\r
+// @name Layers\r
+//\r
+///@{\r
+\r
+/// Specifies the maximum number of layers supported by ovr_SubmitFrame.\r
+///\r
+/// /see ovr_SubmitFrame\r
+///\r
+enum { ovrMaxLayerCount = 16 };\r
+\r
+/// Describes layer types that can be passed to ovr_SubmitFrame.\r
+/// Each layer type has an associated struct, such as ovrLayerEyeFov.\r
+///\r
+/// \see ovrLayerHeader\r
+///\r
+typedef enum ovrLayerType_ {\r
+ /// Layer is disabled.\r
+ ovrLayerType_Disabled = 0,\r
+\r
+ /// Described by ovrLayerEyeFov.\r
+ ovrLayerType_EyeFov = 1,\r
+\r
+ /// Described by ovrLayerEyeFovDepth.\r
+ ovrLayerType_EyeFovDepth = 2,\r
+\r
+ /// Described by ovrLayerQuad. Previously called ovrLayerType_QuadInWorld.\r
+ ovrLayerType_Quad = 3,\r
+\r
+ // enum 4 used to be ovrLayerType_QuadHeadLocked. Instead, use ovrLayerType_Quad with\r
+ // ovrLayerFlag_HeadLocked.\r
+\r
+ /// Described by ovrLayerEyeMatrix.\r
+ ovrLayerType_EyeMatrix = 5,\r
+\r
+\r
+ /// Described by ovrLayerEyeFovMultires.\r
+ ovrLayerType_EyeFovMultires = 7,\r
+\r
+ /// Described by ovrLayerCylinder.\r
+ ovrLayerType_Cylinder = 8,\r
+\r
+ /// Described by ovrLayerCube\r
+ ovrLayerType_Cube = 10,\r
+\r
+\r
+ ovrLayerType_EnumSize = 0x7fffffff ///< Force type int32_t.\r
+\r
+} ovrLayerType;\r
+\r
+/// Identifies flags used by ovrLayerHeader and which are passed to ovr_SubmitFrame.\r
+///\r
+/// \see ovrLayerHeader\r
+///\r
+typedef enum ovrLayerFlags_ {\r
+ /// ovrLayerFlag_HighQuality enables 4x anisotropic sampling during the composition of the layer.\r
+ /// The benefits are mostly visible at the periphery for high-frequency & high-contrast visuals.\r
+ /// For best results consider combining this flag with an ovrTextureSwapChain that has mipmaps and\r
+ /// instead of using arbitrary sized textures, prefer texture sizes that are powers-of-two.\r
+ /// Actual rendered viewport and doesn't necessarily have to fill the whole texture.\r
+ ovrLayerFlag_HighQuality = 0x01,\r
+\r
+ /// ovrLayerFlag_TextureOriginAtBottomLeft: the opposite is TopLeft.\r
+ /// Generally this is false for D3D, true for OpenGL.\r
+ ovrLayerFlag_TextureOriginAtBottomLeft = 0x02,\r
+\r
+ /// Mark this surface as "headlocked", which means it is specified\r
+ /// relative to the HMD and moves with it, rather than being specified\r
+ /// relative to sensor/torso space and remaining still while the head moves.\r
+ /// What used to be ovrLayerType_QuadHeadLocked is now ovrLayerType_Quad plus this flag.\r
+ /// However the flag can be applied to any layer type to achieve a similar effect.\r
+ ovrLayerFlag_HeadLocked = 0x04,\r
+\r
+\r
+} ovrLayerFlags;\r
+\r
+/// Defines properties shared by all ovrLayer structs, such as ovrLayerEyeFov.\r
+///\r
+/// ovrLayerHeader is used as a base member in these larger structs.\r
+/// This struct cannot be used by itself except for the case that Type is ovrLayerType_Disabled.\r
+///\r
+/// \see ovrLayerType, ovrLayerFlags\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerHeader_ {\r
+ ovrLayerType Type; ///< Described by ovrLayerType.\r
+ unsigned Flags; ///< Described by ovrLayerFlags.\r
+} ovrLayerHeader;\r
+\r
+/// Describes a layer that specifies a monoscopic or stereoscopic view.\r
+/// This is the kind of layer that's typically used as layer 0 to ovr_SubmitFrame,\r
+/// as it is the kind of layer used to render a 3D stereoscopic view.\r
+///\r
+/// Three options exist with respect to mono/stereo texture usage:\r
+/// - ColorTexture[0] and ColorTexture[1] contain the left and right stereo renderings,\r
+/// respectively.\r
+/// Viewport[0] and Viewport[1] refer to ColorTexture[0] and ColorTexture[1], respectively.\r
+/// - ColorTexture[0] contains both the left and right renderings, ColorTexture[1] is NULL,\r
+/// and Viewport[0] and Viewport[1] refer to sub-rects with ColorTexture[0].\r
+/// - ColorTexture[0] contains a single monoscopic rendering, and Viewport[0] and\r
+/// Viewport[1] both refer to that rendering.\r
+///\r
+/// \see ovrTextureSwapChain, ovr_SubmitFrame\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeFov_ {\r
+ /// Header.Type must be ovrLayerType_EyeFov.\r
+ ovrLayerHeader Header;\r
+\r
+ /// ovrTextureSwapChains for the left and right eye respectively.\r
+ /// The second one of which can be NULL for cases described above.\r
+ ovrTextureSwapChain ColorTexture[ovrEye_Count];\r
+\r
+ /// Specifies the ColorTexture sub-rect UV coordinates.\r
+ /// Both Viewport[0] and Viewport[1] must be valid.\r
+ ovrRecti Viewport[ovrEye_Count];\r
+\r
+ /// The viewport field of view.\r
+ ovrFovPort Fov[ovrEye_Count];\r
+\r
+ /// Specifies the position and orientation of each eye view, with position specified in meters.\r
+ /// RenderPose will typically be the value returned from ovr_CalcEyePoses,\r
+ /// but can be different in special cases if a different head pose is used for rendering.\r
+ ovrPosef RenderPose[ovrEye_Count];\r
+\r
+ /// Specifies the timestamp when the source ovrPosef (used in calculating RenderPose)\r
+ /// was sampled from the SDK. Typically retrieved by calling ovr_GetTimeInSeconds\r
+ /// around the instant the application calls ovr_GetTrackingState\r
+ /// The main purpose for this is to accurately track app tracking latency.\r
+ double SensorSampleTime;\r
+\r
+} ovrLayerEyeFov;\r
+\r
+/// Describes a layer that specifies a monoscopic or stereoscopic view,\r
+/// with depth textures in addition to color textures. This is typically used to support\r
+/// positional time warp. This struct is the same as ovrLayerEyeFov, but with the addition\r
+/// of DepthTexture and ProjectionDesc.\r
+///\r
+/// ProjectionDesc can be created using ovrTimewarpProjectionDesc_FromProjection.\r
+///\r
+/// Three options exist with respect to mono/stereo texture usage:\r
+/// - ColorTexture[0] and ColorTexture[1] contain the left and right stereo renderings,\r
+/// respectively.\r
+/// Viewport[0] and Viewport[1] refer to ColorTexture[0] and ColorTexture[1], respectively.\r
+/// - ColorTexture[0] contains both the left and right renderings, ColorTexture[1] is NULL,\r
+/// and Viewport[0] and Viewport[1] refer to sub-rects with ColorTexture[0].\r
+/// - ColorTexture[0] contains a single monoscopic rendering, and Viewport[0] and\r
+/// Viewport[1] both refer to that rendering.\r
+///\r
+/// \see ovrTextureSwapChain, ovr_SubmitFrame\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeFovDepth_ {\r
+ /// Header.Type must be ovrLayerType_EyeFovDepth.\r
+ ovrLayerHeader Header;\r
+\r
+ /// ovrTextureSwapChains for the left and right eye respectively.\r
+ /// The second one of which can be NULL for cases described above.\r
+ ovrTextureSwapChain ColorTexture[ovrEye_Count];\r
+\r
+ /// Specifies the ColorTexture sub-rect UV coordinates.\r
+ /// Both Viewport[0] and Viewport[1] must be valid.\r
+ ovrRecti Viewport[ovrEye_Count];\r
+\r
+ /// The viewport field of view.\r
+ ovrFovPort Fov[ovrEye_Count];\r
+\r
+ /// Specifies the position and orientation of each eye view, with position specified in meters.\r
+ /// RenderPose will typically be the value returned from ovr_CalcEyePoses,\r
+ /// but can be different in special cases if a different head pose is used for rendering.\r
+ ovrPosef RenderPose[ovrEye_Count];\r
+\r
+ /// Specifies the timestamp when the source ovrPosef (used in calculating RenderPose)\r
+ /// was sampled from the SDK. Typically retrieved by calling ovr_GetTimeInSeconds\r
+ /// around the instant the application calls ovr_GetTrackingState\r
+ /// The main purpose for this is to accurately track app tracking latency.\r
+ double SensorSampleTime;\r
+\r
+ /// Depth texture for positional timewarp.\r
+ /// Must map 1:1 to the ColorTexture.\r
+ ovrTextureSwapChain DepthTexture[ovrEye_Count];\r
+\r
+ /// Specifies how to convert DepthTexture information into meters.\r
+ /// \see ovrTimewarpProjectionDesc_FromProjection\r
+ ovrTimewarpProjectionDesc ProjectionDesc;\r
+\r
+} ovrLayerEyeFovDepth;\r
+\r
+/// Describes eye texture layouts. Used with ovrLayerEyeFovMultires.\r
+///\r
+typedef enum ovrTextureLayout_ {\r
+ ovrTextureLayout_Rectilinear = 0, ///< Regular eyeFov layer.\r
+ ovrTextureLayout_Octilinear = 1, ///< Octilinear extension must be enabled.\r
+ ovrTextureLayout_EnumSize = 0x7fffffff ///< Force type int32_t.\r
+} ovrTextureLayout;\r
+\r
+/// Multiresolution descriptor for Octilinear.\r
+///\r
+/// Usage of this layer must be successfully enabled via ovr_EnableExtension\r
+/// before it can be used.\r
+///\r
+/// \see ovrLayerEyeFovMultres\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTextureLayoutOctilinear_ {\r
+ // W warping\r
+ float WarpLeft;\r
+ float WarpRight;\r
+ float WarpUp;\r
+ float WarpDown;\r
+\r
+ // Size of W quadrants.\r
+ //\r
+ // SizeLeft + SizeRight <= Viewport.Size.w\r
+ // SizeUp + sizeDown <= Viewport.Size.h\r
+ //\r
+ // Clip space (0,0) is located at Viewport.Pos + (SizeLeft,SizeUp) where\r
+ // Viewport is given in the layer description.\r
+ //\r
+ // Viewport Top left\r
+ // +-----------------------------------------------------+\r
+ // | ^ | |\r
+ // | | | |\r
+ // | 0 SizeUp 1 | |\r
+ // | | |<--Portion of viewport\r
+ // | | | determined by sizes\r
+ // | | | |\r
+ // |<--------SizeLeft-------+-------SizeRight------>| |\r
+ // | | | |\r
+ // | | | |\r
+ // | 2 SizeDown 3 | |\r
+ // | | | |\r
+ // | | | |\r
+ // | v | |\r
+ // +------------------------------------------------+ |\r
+ // | |\r
+ // +-----------------------------------------------------+\r
+ // Viewport bottom right\r
+ //\r
+ // For example, when rendering quadrant 0 its scissor rectangle will be\r
+ //\r
+ // Top = 0\r
+ // Left = 0\r
+ // Right = SizeLeft\r
+ // Bottom = SizeUp\r
+ //\r
+ // and the scissor rectangle for quadrant 1 will be:\r
+ //\r
+ // Top = 0\r
+ // Left = SizeLeft\r
+ // Right = SizeLeft + SizeRight\r
+ // Bottom = SizeUp\r
+ //\r
+ float SizeLeft;\r
+ float SizeRight;\r
+ float SizeUp;\r
+ float SizeDown;\r
+\r
+} ovrTextureLayoutOctilinear;\r
+\r
+/// Combines texture layout descriptors.\r
+///\r
+typedef union OVR_ALIGNAS(OVR_PTR_SIZE) ovrTextureLayoutDesc_Union_ {\r
+ ovrTextureLayoutOctilinear Octilinear[ovrEye_Count];\r
+} ovrTextureLayoutDesc_Union;\r
+\r
+/// Describes a layer that specifies a monoscopic or stereoscopic view with\r
+/// support for optional multiresolution textures. This struct is the same as\r
+/// ovrLayerEyeFov plus texture layout parameters.\r
+///\r
+/// Three options exist with respect to mono/stereo texture usage:\r
+/// - ColorTexture[0] and ColorTexture[1] contain the left and right stereo renderings,\r
+/// respectively.\r
+/// Viewport[0] and Viewport[1] refer to ColorTexture[0] and ColorTexture[1], respectively.\r
+/// - ColorTexture[0] contains both the left and right renderings, ColorTexture[1] is NULL,\r
+/// and Viewport[0] and Viewport[1] refer to sub-rects with ColorTexture[0].\r
+/// - ColorTexture[0] contains a single monoscopic rendering, and Viewport[0] and\r
+/// Viewport[1] both refer to that rendering.\r
+///\r
+/// \see ovrTextureSwapChain, ovr_SubmitFrame\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeFovMultires_ {\r
+ /// Header.Type must be ovrLayerType_EyeFovMultires.\r
+ ovrLayerHeader Header;\r
+\r
+ /// ovrTextureSwapChains for the left and right eye respectively.\r
+ /// The second one of which can be NULL for cases described above.\r
+ ovrTextureSwapChain ColorTexture[ovrEye_Count];\r
+\r
+ /// Specifies the ColorTexture sub-rect UV coordinates.\r
+ /// Both Viewport[0] and Viewport[1] must be valid.\r
+ ovrRecti Viewport[ovrEye_Count];\r
+\r
+ /// The viewport field of view.\r
+ ovrFovPort Fov[ovrEye_Count];\r
+\r
+ /// Specifies the position and orientation of each eye view, with position specified in meters.\r
+ /// RenderPose will typically be the value returned from ovr_CalcEyePoses,\r
+ /// but can be different in special cases if a different head pose is used for rendering.\r
+ ovrPosef RenderPose[ovrEye_Count];\r
+\r
+ /// Specifies the timestamp when the source ovrPosef (used in calculating RenderPose)\r
+ /// was sampled from the SDK. Typically retrieved by calling ovr_GetTimeInSeconds\r
+ /// around the instant the application calls ovr_GetTrackingState\r
+ /// The main purpose for this is to accurately track app tracking latency.\r
+ double SensorSampleTime;\r
+\r
+ /// Specifies layout type of textures.\r
+ ovrTextureLayout TextureLayout;\r
+\r
+ /// Specifies texture layout parameters.\r
+ ovrTextureLayoutDesc_Union TextureLayoutDesc;\r
+\r
+} ovrLayerEyeFovMultires;\r
+\r
+/// Describes a layer that specifies a monoscopic or stereoscopic view.\r
+/// This uses a direct 3x4 matrix to map from view space to the UV coordinates.\r
+/// It is essentially the same thing as ovrLayerEyeFov but using a much\r
+/// lower level. This is mainly to provide compatibility with specific apps.\r
+/// Unless the application really requires this flexibility, it is usually better\r
+/// to use ovrLayerEyeFov.\r
+///\r
+/// Three options exist with respect to mono/stereo texture usage:\r
+/// - ColorTexture[0] and ColorTexture[1] contain the left and right stereo renderings,\r
+/// respectively.\r
+/// Viewport[0] and Viewport[1] refer to ColorTexture[0] and ColorTexture[1], respectively.\r
+/// - ColorTexture[0] contains both the left and right renderings, ColorTexture[1] is NULL,\r
+/// and Viewport[0] and Viewport[1] refer to sub-rects with ColorTexture[0].\r
+/// - ColorTexture[0] contains a single monoscopic rendering, and Viewport[0] and\r
+/// Viewport[1] both refer to that rendering.\r
+///\r
+/// \see ovrTextureSwapChain, ovr_SubmitFrame\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeMatrix_ {\r
+ /// Header.Type must be ovrLayerType_EyeMatrix.\r
+ ovrLayerHeader Header;\r
+\r
+ /// ovrTextureSwapChains for the left and right eye respectively.\r
+ /// The second one of which can be NULL for cases described above.\r
+ ovrTextureSwapChain ColorTexture[ovrEye_Count];\r
+\r
+ /// Specifies the ColorTexture sub-rect UV coordinates.\r
+ /// Both Viewport[0] and Viewport[1] must be valid.\r
+ ovrRecti Viewport[ovrEye_Count];\r
+\r
+ /// Specifies the position and orientation of each eye view, with position specified in meters.\r
+ /// RenderPose will typically be the value returned from ovr_CalcEyePoses,\r
+ /// but can be different in special cases if a different head pose is used for rendering.\r
+ ovrPosef RenderPose[ovrEye_Count];\r
+\r
+ /// Specifies the mapping from a view-space vector\r
+ /// to a UV coordinate on the textures given above.\r
+ /// P = (x,y,z,1)*Matrix\r
+ /// TexU = P.x/P.z\r
+ /// TexV = P.y/P.z\r
+ ovrMatrix4f Matrix[ovrEye_Count];\r
+\r
+ /// Specifies the timestamp when the source ovrPosef (used in calculating RenderPose)\r
+ /// was sampled from the SDK. Typically retrieved by calling ovr_GetTimeInSeconds\r
+ /// around the instant the application calls ovr_GetTrackingState\r
+ /// The main purpose for this is to accurately track app tracking latency.\r
+ double SensorSampleTime;\r
+\r
+} ovrLayerEyeMatrix;\r
+\r
+/// Describes a layer of Quad type, which is a single quad in world or viewer space.\r
+/// It is used for ovrLayerType_Quad. This type of layer represents a single\r
+/// object placed in the world and not a stereo view of the world itself.\r
+///\r
+/// A typical use of ovrLayerType_Quad is to draw a television screen in a room\r
+/// that for some reason is more convenient to draw as a layer than as part of the main\r
+/// view in layer 0. For example, it could implement a 3D popup GUI that is drawn at a\r
+/// higher resolution than layer 0 to improve fidelity of the GUI.\r
+///\r
+/// Quad layers are visible from both sides; they are not back-face culled.\r
+///\r
+/// \see ovrTextureSwapChain, ovr_SubmitFrame\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerQuad_ {\r
+ /// Header.Type must be ovrLayerType_Quad.\r
+ ovrLayerHeader Header;\r
+\r
+ /// Contains a single image, never with any stereo view.\r
+ ovrTextureSwapChain ColorTexture;\r
+\r
+ /// Specifies the ColorTexture sub-rect UV coordinates.\r
+ ovrRecti Viewport;\r
+\r
+ /// Specifies the orientation and position of the center point of a Quad layer type.\r
+ /// The supplied direction is the vector perpendicular to the quad.\r
+ /// The position is in real-world meters (not the application's virtual world,\r
+ /// the physical world the user is in) and is relative to the "zero" position\r
+ /// set by ovr_RecenterTrackingOrigin unless the ovrLayerFlag_HeadLocked flag is used.\r
+ ovrPosef QuadPoseCenter;\r
+\r
+ /// Width and height (respectively) of the quad in meters.\r
+ ovrVector2f QuadSize;\r
+\r
+} ovrLayerQuad;\r
+\r
+/// Describes a layer of type ovrLayerType_Cylinder which is a single cylinder\r
+/// relative to the recentered origin. This type of layer represents a single\r
+/// object placed in the world and not a stereo view of the world itself.\r
+///\r
+/// -Z +Y\r
+/// U=0 +--+--+ U=1\r
+/// +---+ | +---+ +-----------------+ - V=0\r
+/// +--+ \ | / +--+ | | |\r
+/// +-+ \ / +-+ | | |\r
+/// ++ \ A / ++ | | |\r
+/// ++ \---/ ++ | | |\r
+/// | \ / | | +X | |\r
+/// +-------------C------R------+ +X +--------C--------+ | <--- Height\r
+/// (+Y is out of screen) | | |\r
+/// | | |\r
+/// R = Radius | | |\r
+/// A = Angle (0,2*Pi) | | |\r
+/// C = CylinderPoseCenter | | |\r
+/// U/V = UV Coordinates +-----------------+ - V=1\r
+///\r
+/// An identity CylinderPoseCenter places the center of the cylinder\r
+/// at the recentered origin unless the headlocked flag is set.\r
+///\r
+/// Does not utilize HmdSpaceToWorldScaleInMeters. If necessary, adjust\r
+/// translation and radius.\r
+///\r
+/// \note Only the interior surface of the cylinder is visible. Use cylinder\r
+/// layers when the user cannot leave the extents of the cylinder. Artifacts may\r
+/// appear when viewing the cylinder's exterior surface. Additionally, while the\r
+/// interface supports an Angle that ranges from [0,2*Pi] the angle should\r
+/// remain less than 1.9*PI to avoid artifacts where the cylinder edges\r
+/// converge.\r
+///\r
+/// \see ovrTextureSwapChain, ovr_SubmitFrame\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerCylinder_ {\r
+ /// Header.Type must be ovrLayerType_Cylinder.\r
+ ovrLayerHeader Header;\r
+\r
+ /// Contains a single image, never with any stereo view.\r
+ ovrTextureSwapChain ColorTexture;\r
+\r
+ /// Specifies the ColorTexture sub-rect UV coordinates.\r
+ ovrRecti Viewport;\r
+\r
+ /// Specifies the orientation and position of the center point of a cylinder layer type.\r
+ /// The position is in real-world meters not the application's virtual world,\r
+ /// but the physical world the user is in. It is relative to the "zero" position\r
+ /// set by ovr_RecenterTrackingOrigin unless the ovrLayerFlag_HeadLocked flag is used.\r
+ ovrPosef CylinderPoseCenter;\r
+\r
+ /// Radius of the cylinder in meters.\r
+ float CylinderRadius;\r
+\r
+ /// Angle in radians. Range is from 0 to 2*Pi exclusive covering the entire\r
+ /// cylinder (see diagram and note above).\r
+ float CylinderAngle;\r
+\r
+ /// Custom aspect ratio presumably set based on 'Viewport'. Used to\r
+ /// calculate the height of the cylinder based on the arc-length (CylinderAngle)\r
+ /// and radius (CylinderRadius) given above. The height of the cylinder is\r
+ /// given by: height = (CylinderRadius * CylinderAngle) / CylinderAspectRatio.\r
+ /// Aspect ratio is width / height.\r
+ float CylinderAspectRatio;\r
+\r
+} ovrLayerCylinder;\r
+\r
+/// Describes a layer of type ovrLayerType_Cube which is a single timewarped\r
+/// cubemap at infinity. When looking down the recentered origin's -Z axis, +X\r
+/// face is left and +Y face is up. Similarly, if headlocked the +X face is\r
+/// left, +Y face is up and -Z face is forward. Note that the coordinate system\r
+/// is left-handed.\r
+///\r
+/// ovrLayerFlag_TextureOriginAtBottomLeft flag is not supported by ovrLayerCube.\r
+///\r
+/// \see ovrTextureSwapChain, ovr_SubmitFrame\r
+///\r
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerCube_ {\r
+ /// Header.Type must be ovrLayerType_Cube.\r
+ ovrLayerHeader Header;\r
+\r
+ /// Orientation of the cube.\r
+ ovrQuatf Orientation;\r
+\r
+ /// Contains a single cubemap swapchain (not a stereo pair of swapchains).\r
+ ovrTextureSwapChain CubeMapTexture;\r
+} ovrLayerCube;\r
+\r
+\r
+\r
+/// Union that combines ovrLayer types in a way that allows them\r
+/// to be used in a polymorphic way.\r
+typedef union ovrLayer_Union_ {\r
+ ovrLayerHeader Header;\r
+ ovrLayerEyeFov EyeFov;\r
+ ovrLayerEyeFovDepth EyeFovDepth;\r
+ ovrLayerQuad Quad;\r
+ ovrLayerEyeFovMultires Multires;\r
+ ovrLayerCylinder Cylinder;\r
+ ovrLayerCube Cube;\r
+} ovrLayer_Union;\r
+\r
+//@}\r
+\r
+#if !defined(OVR_EXPORTING_CAPI)\r
+\r
+/// @name SDK Distortion Rendering\r
+///\r
+/// All of rendering functions including the configure and frame functions\r
+/// are not thread safe. It is OK to use ConfigureRendering on one thread and handle\r
+/// frames on another thread, but explicit synchronization must be done since\r
+/// functions that depend on configured state are not reentrant.\r
+///\r
+/// These functions support rendering of distortion by the SDK.\r
+///\r
+//@{\r
+\r
+/// TextureSwapChain creation is rendering API-specific.\r
+/// ovr_CreateTextureSwapChainDX and ovr_CreateTextureSwapChainGL can be found in the\r
+/// rendering API-specific headers, such as OVR_CAPI_D3D.h and OVR_CAPI_GL.h\r
+\r
+/// Gets the number of buffers in an ovrTextureSwapChain.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] chain Specifies the ovrTextureSwapChain for which the length should be retrieved.\r
+/// \param[out] out_Length Returns the number of buffers in the specified chain.\r
+///\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error.\r
+///\r
+/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetTextureSwapChainLength(ovrSession session, ovrTextureSwapChain chain, int* out_Length);\r
+\r
+/// Gets the current index in an ovrTextureSwapChain.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] chain Specifies the ovrTextureSwapChain for which the index should be retrieved.\r
+/// \param[out] out_Index Returns the current (free) index in specified chain.\r
+///\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error.\r
+///\r
+/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetTextureSwapChainCurrentIndex(ovrSession session, ovrTextureSwapChain chain, int* out_Index);\r
+\r
+/// Gets the description of the buffers in an ovrTextureSwapChain\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] chain Specifies the ovrTextureSwapChain for which the description\r
+/// should be retrieved.\r
+/// \param[out] out_Desc Returns the description of the specified chain.\r
+///\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error.\r
+///\r
+/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_GetTextureSwapChainDesc(\r
+ ovrSession session,\r
+ ovrTextureSwapChain chain,\r
+ ovrTextureSwapChainDesc* out_Desc);\r
+\r
+/// Commits any pending changes to an ovrTextureSwapChain, and advances its current index\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] chain Specifies the ovrTextureSwapChain to commit.\r
+///\r
+/// \note When Commit is called, the texture at the current index is considered ready for use by the\r
+/// runtime, and further writes to it should be avoided. The swap chain's current index is advanced,\r
+/// providing there's room in the chain. The next time the SDK dereferences this texture swap chain,\r
+/// it will synchronize with the app's graphics context and pick up the submitted index, opening up\r
+/// room in the swap chain for further commits.\r
+///\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error.\r
+/// Failures include but aren't limited to:\r
+/// - ovrError_TextureSwapChainFull: ovr_CommitTextureSwapChain was called too many times on a\r
+/// texture swapchain without calling submit to use the chain.\r
+///\r
+/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_CommitTextureSwapChain(ovrSession session, ovrTextureSwapChain chain);\r
+\r
+/// Destroys an ovrTextureSwapChain and frees all the resources associated with it.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] chain Specifies the ovrTextureSwapChain to destroy. If it is NULL then\r
+/// this function has no effect.\r
+///\r
+/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL\r
+///\r
+OVR_PUBLIC_FUNCTION(void)\r
+ovr_DestroyTextureSwapChain(ovrSession session, ovrTextureSwapChain chain);\r
+\r
+/// MirrorTexture creation is rendering API-specific.\r
+/// ovr_CreateMirrorTextureWithOptionsDX and ovr_CreateMirrorTextureWithOptionsGL can be found in\r
+/// rendering API-specific headers, such as OVR_CAPI_D3D.h and OVR_CAPI_GL.h\r
+\r
+/// Destroys a mirror texture previously created by one of the mirror texture creation functions.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] mirrorTexture Specifies the ovrTexture to destroy. If it is NULL then\r
+/// this function has no effect.\r
+///\r
+/// \see ovr_CreateMirrorTextureWithOptionsDX, ovr_CreateMirrorTextureWithOptionsGL\r
+///\r
+OVR_PUBLIC_FUNCTION(void)\r
+ovr_DestroyMirrorTexture(ovrSession session, ovrMirrorTexture mirrorTexture);\r
+\r
+/// Calculates the recommended viewport size for rendering a given eye within the HMD\r
+/// with a given FOV cone.\r
+///\r
+/// Higher FOV will generally require larger textures to maintain quality.\r
+/// Apps packing multiple eye views together on the same texture should ensure there are\r
+/// at least 8 pixels of padding between them to prevent texture filtering and chromatic\r
+/// aberration causing images to leak between the two eye views.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] eye Specifies which eye (left or right) to calculate for.\r
+/// \param[in] fov Specifies the ovrFovPort to use.\r
+/// \param[in] pixelsPerDisplayPixel Specifies the ratio of the number of render target pixels\r
+/// to display pixels at the center of distortion. 1.0 is the default value. Lower\r
+/// values can improve performance, higher values give improved quality.\r
+///\r
+/// <b>Example code</b>\r
+/// \code{.cpp}\r
+/// ovrHmdDesc hmdDesc = ovr_GetHmdDesc(session);\r
+/// ovrSizei eyeSizeLeft = ovr_GetFovTextureSize(session, ovrEye_Left,\r
+/// hmdDesc.DefaultEyeFov[ovrEye_Left], 1.0f);\r
+/// ovrSizei eyeSizeRight = ovr_GetFovTextureSize(session, ovrEye_Right,\r
+/// hmdDesc.DefaultEyeFov[ovrEye_Right], 1.0f);\r
+/// \endcode\r
+///\r
+/// \return Returns the texture width and height size.\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrSizei)\r
+ovr_GetFovTextureSize(\r
+ ovrSession session,\r
+ ovrEyeType eye,\r
+ ovrFovPort fov,\r
+ float pixelsPerDisplayPixel);\r
+\r
+/// Computes the distortion viewport, view adjust, and other rendering parameters for\r
+/// the specified eye.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] eyeType Specifies which eye (left or right) for which to perform calculations.\r
+/// \param[in] fov Specifies the ovrFovPort to use.\r
+///\r
+/// \return Returns the computed ovrEyeRenderDesc for the given eyeType and field of view.\r
+///\r
+/// \see ovrEyeRenderDesc\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrEyeRenderDesc)\r
+ovr_GetRenderDesc(ovrSession session, ovrEyeType eyeType, ovrFovPort fov);\r
+\r
+/// Waits until surfaces are available and it is time to begin rendering the frame. Must be\r
+/// called before ovr_BeginFrame, but not necessarily from the same thread.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+///\r
+/// \param[in] frameIndex Specifies the targeted application frame index.\r
+///\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: command completed successfully.\r
+/// - ovrSuccess_NotVisible: rendering of a previous frame completed successfully but was not\r
+/// displayed on the HMD, usually because another application currently has ownership of the\r
+/// HMD. Applications receiving this result should stop rendering new content and call\r
+/// ovr_GetSessionStatus to detect visibility.\r
+/// - ovrError_DisplayLost: The session has become invalid (such as due to a device removal)\r
+/// and the shared resources need to be released (ovr_DestroyTextureSwapChain), the session\r
+/// needs to destroyed (ovr_Destroy) and recreated (ovr_Create), and new resources need to be\r
+/// created (ovr_CreateTextureSwapChainXXX). The application's existing private graphics\r
+/// resources do not need to be recreated unless the new ovr_Create call returns a different\r
+/// GraphicsLuid.\r
+///\r
+/// \see ovr_BeginFrame, ovr_EndFrame, ovr_GetSessionStatus\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_WaitToBeginFrame(ovrSession session, long long frameIndex);\r
+\r
+/// Called from render thread before application begins rendering. Must be called after\r
+/// ovr_WaitToBeginFrame and before ovr_EndFrame, but not necessarily from the same threads.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+///\r
+/// \param[in] frameIndex Specifies the targeted application frame index. It must match what was\r
+/// passed to ovr_WaitToBeginFrame.\r
+///\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: command completed successfully.\r
+/// - ovrError_DisplayLost: The session has become invalid (such as due to a device removal)\r
+/// and the shared resources need to be released (ovr_DestroyTextureSwapChain), the session\r
+/// needs to destroyed (ovr_Destroy) and recreated (ovr_Create), and new resources need to be\r
+/// created (ovr_CreateTextureSwapChainXXX). The application's existing private graphics\r
+/// resources do not need to be recreated unless the new ovr_Create call returns a different\r
+/// GraphicsLuid.\r
+///\r
+/// \see ovr_WaitToBeginFrame, ovr_EndFrame\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_BeginFrame(ovrSession session, long long frameIndex);\r
+\r
+/// Called from render thread after application has finished rendering. Must be called after\r
+/// ovr_BeginFrame, but not necessarily from the same thread. Submits layers for distortion and\r
+/// display, which will happen asynchronously.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+///\r
+/// \param[in] frameIndex Specifies the targeted application frame index. It must match what was\r
+/// passed to ovr_BeginFrame.\r
+///\r
+/// \param[in] viewScaleDesc Provides additional information needed only if layerPtrList contains\r
+/// an ovrLayerType_Quad. If NULL, a default version is used based on the current\r
+/// configuration and a 1.0 world scale.\r
+///\r
+/// \param[in] layerPtrList Specifies a list of ovrLayer pointers, which can include NULL entries to\r
+/// indicate that any previously shown layer at that index is to not be displayed.\r
+/// Each layer header must be a part of a layer structure such as ovrLayerEyeFov or\r
+/// ovrLayerQuad, with Header.Type identifying its type. A NULL layerPtrList entry in the\r
+/// array indicates the absence of the given layer.\r
+///\r
+/// \param[in] layerCount Indicates the number of valid elements in layerPtrList. The maximum\r
+/// supported layerCount is not currently specified, but may be specified in a future\r
+/// version.\r
+///\r
+/// - Layers are drawn in the order they are specified in the array, regardless of the layer type.\r
+///\r
+/// - Layers are not remembered between successive calls to ovr_SubmitFrame. A layer must be\r
+/// specified in every call to ovr_SubmitFrame or it won't be displayed.\r
+///\r
+/// - If a layerPtrList entry that was specified in a previous call to ovr_SubmitFrame is\r
+/// passed as NULL or is of type ovrLayerType_Disabled, that layer is no longer displayed.\r
+///\r
+/// - A layerPtrList entry can be of any layer type and multiple entries of the same layer type\r
+/// are allowed. No layerPtrList entry may be duplicated (i.e. the same pointer as an earlier\r
+/// entry).\r
+///\r
+/// <b>Example code</b>\r
+/// \code{.cpp}\r
+/// ovrLayerEyeFov layer0;\r
+/// ovrLayerQuad layer1;\r
+/// ...\r
+/// ovrLayerHeader* layers[2] = { &layer0.Header, &layer1.Header };\r
+/// ovrResult result = ovr_EndFrame(session, frameIndex, nullptr, layers, 2);\r
+/// \endcode\r
+///\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: rendering completed successfully.\r
+/// - ovrError_DisplayLost: The session has become invalid (such as due to a device removal)\r
+/// and the shared resources need to be released (ovr_DestroyTextureSwapChain), the session\r
+/// needs to destroyed (ovr_Destroy) and recreated (ovr_Create), and new resources need to be\r
+/// created (ovr_CreateTextureSwapChainXXX). The application's existing private graphics\r
+/// resources do not need to be recreated unless the new ovr_Create call returns a different\r
+/// GraphicsLuid.\r
+/// - ovrError_TextureSwapChainInvalid: The ovrTextureSwapChain is in an incomplete or\r
+/// inconsistent state. Ensure ovr_CommitTextureSwapChain was called at least once first.\r
+///\r
+/// \see ovr_WaitToBeginFrame, ovr_BeginFrame, ovrViewScaleDesc, ovrLayerHeader\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_EndFrame(\r
+ ovrSession session,\r
+ long long frameIndex,\r
+ const ovrViewScaleDesc* viewScaleDesc,\r
+ ovrLayerHeader const* const* layerPtrList,\r
+ unsigned int layerCount);\r
+\r
+/// Submits layers for distortion and display.\r
+///\r
+/// Deprecated. Use ovr_WaitToBeginFrame, ovr_BeginFrame, and ovr_EndFrame instead.\r
+///\r
+/// ovr_SubmitFrame triggers distortion and processing which might happen asynchronously.\r
+/// The function will return when there is room in the submission queue and surfaces\r
+/// are available. Distortion might or might not have completed.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+///\r
+/// \param[in] frameIndex Specifies the targeted application frame index, or 0 to refer to one frame\r
+/// after the last time ovr_SubmitFrame was called.\r
+///\r
+/// \param[in] viewScaleDesc Provides additional information needed only if layerPtrList contains\r
+/// an ovrLayerType_Quad. If NULL, a default version is used based on the current\r
+/// configuration and a 1.0 world scale.\r
+///\r
+/// \param[in] layerPtrList Specifies a list of ovrLayer pointers, which can include NULL entries to\r
+/// indicate that any previously shown layer at that index is to not be displayed.\r
+/// Each layer header must be a part of a layer structure such as ovrLayerEyeFov or\r
+/// ovrLayerQuad, with Header.Type identifying its type. A NULL layerPtrList entry in the\r
+/// array indicates the absence of the given layer.\r
+///\r
+/// \param[in] layerCount Indicates the number of valid elements in layerPtrList. The maximum\r
+/// supported layerCount is not currently specified, but may be specified in a future\r
+/// version.\r
+///\r
+/// - Layers are drawn in the order they are specified in the array, regardless of the layer type.\r
+///\r
+/// - Layers are not remembered between successive calls to ovr_SubmitFrame. A layer must be\r
+/// specified in every call to ovr_SubmitFrame or it won't be displayed.\r
+///\r
+/// - If a layerPtrList entry that was specified in a previous call to ovr_SubmitFrame is\r
+/// passed as NULL or is of type ovrLayerType_Disabled, that layer is no longer displayed.\r
+///\r
+/// - A layerPtrList entry can be of any layer type and multiple entries of the same layer type\r
+/// are allowed. No layerPtrList entry may be duplicated (i.e. the same pointer as an earlier\r
+/// entry).\r
+///\r
+/// <b>Example code</b>\r
+/// \code{.cpp}\r
+/// ovrLayerEyeFov layer0;\r
+/// ovrLayerQuad layer1;\r
+/// ...\r
+/// ovrLayerHeader* layers[2] = { &layer0.Header, &layer1.Header };\r
+/// ovrResult result = ovr_SubmitFrame(session, frameIndex, nullptr, layers, 2);\r
+/// \endcode\r
+///\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success. Return values include but aren't limited to:\r
+/// - ovrSuccess: rendering completed successfully.\r
+/// - ovrSuccess_NotVisible: rendering completed successfully but was not displayed on the HMD,\r
+/// usually because another application currently has ownership of the HMD. Applications\r
+/// receiving this result should stop rendering new content, call ovr_GetSessionStatus\r
+/// to detect visibility.\r
+/// - ovrError_DisplayLost: The session has become invalid (such as due to a device removal)\r
+/// and the shared resources need to be released (ovr_DestroyTextureSwapChain), the session\r
+/// needs to destroyed (ovr_Destroy) and recreated (ovr_Create), and new resources need to be\r
+/// created (ovr_CreateTextureSwapChainXXX). The application's existing private graphics\r
+/// resources do not need to be recreated unless the new ovr_Create call returns a different\r
+/// GraphicsLuid.\r
+/// - ovrError_TextureSwapChainInvalid: The ovrTextureSwapChain is in an incomplete or\r
+/// inconsistent state. Ensure ovr_CommitTextureSwapChain was called at least once first.\r
+///\r
+/// \see ovr_GetPredictedDisplayTime, ovrViewScaleDesc, ovrLayerHeader, ovr_GetSessionStatus\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult)\r
+ovr_SubmitFrame(\r
+ ovrSession session,\r
+ long long frameIndex,\r
+ const ovrViewScaleDesc* viewScaleDesc,\r
+ ovrLayerHeader const* const* layerPtrList,\r
+ unsigned int layerCount);\r
+///@}\r
+\r
+#endif // !defined(OVR_EXPORTING_CAPI)\r
+\r
+//-------------------------------------------------------------------------------------\r
+/// @name Frame Timing\r
+///\r
+//@{\r
+\r
+///\r
+/// Contains the performance stats for a given SDK compositor frame\r
+///\r
+/// All of the 'int' typed fields can be reset via the ovr_ResetPerfStats call.\r
+///\r
+typedef struct OVR_ALIGNAS(4) ovrPerfStatsPerCompositorFrame_ {\r
+ /// Vsync Frame Index - increments with each HMD vertical synchronization signal (i.e. vsync or\r
+ /// refresh rate)\r
+ /// If the compositor drops a frame, expect this value to increment more than 1 at a time.\r
+ int HmdVsyncIndex;\r
+\r
+ ///\r
+ /// Application stats\r
+ ///\r
+\r
+ /// Index that increments with each successive ovr_SubmitFrame call\r
+ int AppFrameIndex;\r
+\r
+ /// If the app fails to call ovr_SubmitFrame on time, then expect this value to increment with\r
+ /// each missed frame\r
+ int AppDroppedFrameCount;\r
+\r
+ /// Motion-to-photon latency for the application\r
+ /// This value is calculated by either using the SensorSampleTime provided for the ovrLayerEyeFov\r
+ /// or if that\r
+ /// is not available, then the call to ovr_GetTrackingState which has latencyMarker set to ovrTrue\r
+ float AppMotionToPhotonLatency;\r
+\r
+ /// Amount of queue-ahead in seconds provided to the app based on performance and overlap of\r
+ /// CPU and GPU utilization. A value of 0.0 would mean the CPU & GPU workload is being completed\r
+ /// in 1 frame's worth of time, while 11 ms (on the CV1) of queue ahead would indicate that the\r
+ /// app's CPU workload for the next frame is overlapping the GPU workload for the current frame.\r
+ float AppQueueAheadTime;\r
+\r
+ /// Amount of time in seconds spent on the CPU by the app's render-thread that calls\r
+ /// ovr_SubmitFram. Measured as elapsed time between from when app regains control from\r
+ /// ovr_SubmitFrame to the next time the app calls ovr_SubmitFrame.\r
+ float AppCpuElapsedTime;\r
+\r
+ /// Amount of time in seconds spent on the GPU by the app.\r
+ /// Measured as elapsed time between each ovr_SubmitFrame call using GPU timing queries.\r
+ float AppGpuElapsedTime;\r
+\r
+ ///\r
+ /// SDK Compositor stats\r
+ ///\r
+\r
+ /// Index that increments each time the SDK compositor completes a distortion and timewarp pass\r
+ /// Since the compositor operates asynchronously, even if the app calls ovr_SubmitFrame too late,\r
+ /// the compositor will kick off for each vsync.\r
+ int CompositorFrameIndex;\r
+\r
+ /// Increments each time the SDK compositor fails to complete in time\r
+ /// This is not tied to the app's performance, but failure to complete can be related to other\r
+ /// factors such as OS capabilities, overall available hardware cycles to execute the compositor\r
+ /// in time and other factors outside of the app's control.\r
+ int CompositorDroppedFrameCount;\r
+\r
+ /// Motion-to-photon latency of the SDK compositor in seconds.\r
+ /// This is the latency of timewarp which corrects the higher app latency as well as dropped app\r
+ /// frames.\r
+ float CompositorLatency;\r
+\r
+ /// The amount of time in seconds spent on the CPU by the SDK compositor. Unless the\r
+ /// VR app is utilizing all of the CPU cores at their peak performance, there is a good chance the\r
+ /// compositor CPU times will not affect the app's CPU performance in a major way.\r
+ float CompositorCpuElapsedTime;\r
+\r
+ /// The amount of time in seconds spent on the GPU by the SDK compositor. Any time spent on the\r
+ /// compositor will eat away from the available GPU time for the app.\r
+ float CompositorGpuElapsedTime;\r
+\r
+ /// The amount of time in seconds spent from the point the CPU kicks off the compositor to the\r
+ /// point in time the compositor completes the distortion & timewarp on the GPU. In the event the\r
+ /// GPU time is not available, expect this value to be -1.0f.\r
+ float CompositorCpuStartToGpuEndElapsedTime;\r
+\r
+ /// The amount of time in seconds left after the compositor is done on the GPU to the associated\r
+ /// V-Sync time. In the event the GPU time is not available, expect this value to be -1.0f.\r
+ float CompositorGpuEndToVsyncElapsedTime;\r
+\r
+ ///\r
+ /// Async Spacewarp stats (ASW)\r
+ ///\r
+\r
+ /// Will be true if ASW is active for the given frame such that the application is being forced\r
+ /// into half the frame-rate while the compositor continues to run at full frame-rate.\r
+ ovrBool AswIsActive;\r
+\r
+ /// Increments each time ASW it activated where the app was forced in and out of\r
+ /// half-rate rendering.\r
+ int AswActivatedToggleCount;\r
+\r
+ /// Accumulates the number of frames presented by the compositor which had extrapolated\r
+ /// ASW frames presented.\r
+ int AswPresentedFrameCount;\r
+\r
+ /// Accumulates the number of frames that the compositor tried to present when ASW is\r
+ /// active but failed.\r
+ int AswFailedFrameCount;\r
+\r
+} ovrPerfStatsPerCompositorFrame;\r
+\r
+///\r
+/// Maximum number of frames of performance stats provided back to the caller of ovr_GetPerfStats\r
+///\r
+enum { ovrMaxProvidedFrameStats = 5 };\r
+\r
+///\r
+/// This is a complete descriptor of the performance stats provided by the SDK\r
+///\r
+/// \see ovr_GetPerfStats, ovrPerfStatsPerCompositorFrame\r
+typedef struct OVR_ALIGNAS(4) ovrPerfStats_ {\r
+ /// FrameStatsCount will have a maximum value set by ovrMaxProvidedFrameStats\r
+ /// If the application calls ovr_GetPerfStats at the native refresh rate of the HMD\r
+ /// then FrameStatsCount will be 1. If the app's workload happens to force\r
+ /// ovr_GetPerfStats to be called at a lower rate, then FrameStatsCount will be 2 or more.\r
+ /// If the app does not want to miss any performance data for any frame, it needs to\r
+ /// ensure that it is calling ovr_SubmitFrame and ovr_GetPerfStats at a rate that is at least:\r
+ /// "HMD_refresh_rate / ovrMaxProvidedFrameStats". On the Oculus Rift CV1 HMD, this will\r
+ /// be equal to 18 times per second.\r
+ ///\r
+ /// The performance entries will be ordered in reverse chronological order such that the\r
+ /// first entry will be the most recent one.\r
+ ovrPerfStatsPerCompositorFrame FrameStats[ovrMaxProvidedFrameStats];\r
+ int FrameStatsCount;\r
+\r
+ /// If the app calls ovr_GetPerfStats at less than 18 fps for CV1, then AnyFrameStatsDropped\r
+ /// will be ovrTrue and FrameStatsCount will be equal to ovrMaxProvidedFrameStats.\r
+ ovrBool AnyFrameStatsDropped;\r
+\r
+ /// AdaptiveGpuPerformanceScale is an edge-filtered value that a caller can use to adjust\r
+ /// the graphics quality of the application to keep the GPU utilization in check. The value\r
+ /// is calculated as: (desired_GPU_utilization / current_GPU_utilization)\r
+ /// As such, when this value is 1.0, the GPU is doing the right amount of work for the app.\r
+ /// Lower values mean the app needs to pull back on the GPU utilization.\r
+ /// If the app is going to directly drive render-target resolution using this value, then\r
+ /// be sure to take the square-root of the value before scaling the resolution with it.\r
+ /// Changing render target resolutions however is one of the many things an app can do\r
+ /// increase or decrease the amount of GPU utilization.\r
+ /// Since AdaptiveGpuPerformanceScale is edge-filtered and does not change rapidly\r
+ /// (i.e. reports non-1.0 values once every couple of seconds) the app can make the\r
+ /// necessary adjustments and then keep watching the value to see if it has been satisfied.\r
+ float AdaptiveGpuPerformanceScale;\r
+\r
+ /// Will be true if Async Spacewarp (ASW) is available for this system which is dependent on\r
+ /// several factors such as choice of GPU, OS and debug overrides\r
+ ovrBool AswIsAvailable;\r
+\r
+ /// Contains the Process ID of the VR application the stats are being polled for\r
+ /// If an app continues to grab perf stats even when it is not visible, then expect this\r
+ /// value to point to the other VR app that has grabbed focus (i.e. became visible)\r
+ ovrProcessId VisibleProcessId;\r
+} ovrPerfStats;\r
+\r
+#if !defined(OVR_EXPORTING_CAPI)\r
+\r
+/// Retrieves performance stats for the VR app as well as the SDK compositor.\r
+///\r
+/// This function will return stats for the VR app that is currently visible in the HMD\r
+/// regardless of what VR app is actually calling this function.\r
+///\r
+/// If the VR app is trying to make sure the stats returned belong to the same application,\r
+/// the caller can compare the VisibleProcessId with their own process ID. Normally this will\r
+/// be the case if the caller is only calling ovr_GetPerfStats when ovr_GetSessionStatus has\r
+/// IsVisible flag set to be true.\r
+///\r
+/// If the VR app calling ovr_GetPerfStats is actually the one visible in the HMD,\r
+/// then new perf stats will only be populated after a new call to ovr_SubmitFrame.\r
+/// That means subsequent calls to ovr_GetPerfStats after the first one without calling\r
+/// ovr_SubmitFrame will receive a FrameStatsCount of zero.\r
+///\r
+/// If the VR app is not visible, or was initially marked as ovrInit_Invisible, then each call\r
+/// to ovr_GetPerfStats will immediately fetch new perf stats from the compositor without\r
+/// a need for the ovr_SubmitFrame call.\r
+///\r
+/// Even though invisible VR apps do not require ovr_SubmitFrame to be called to gather new\r
+/// perf stats, since stats are generated at the native refresh rate of the HMD (i.e. 90 Hz\r
+/// for CV1), calling it at a higher rate than that would be unnecessary.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[out] outStats Contains the performance stats for the application and SDK compositor\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success.\r
+///\r
+/// \see ovrPerfStats, ovrPerfStatsPerCompositorFrame, ovr_ResetPerfStats\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetPerfStats(ovrSession session, ovrPerfStats* outStats);\r
+\r
+/// Resets the accumulated stats reported in each ovrPerfStatsPerCompositorFrame back to zero.\r
+///\r
+/// Only the integer values such as HmdVsyncIndex, AppDroppedFrameCount etc. will be reset\r
+/// as the other fields such as AppMotionToPhotonLatency are independent timing values updated\r
+/// per-frame.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true\r
+/// upon success.\r
+///\r
+/// \see ovrPerfStats, ovrPerfStatsPerCompositorFrame, ovr_GetPerfStats\r
+///\r
+OVR_PUBLIC_FUNCTION(ovrResult) ovr_ResetPerfStats(ovrSession session);\r
+\r
+/// Gets the time of the specified frame midpoint.\r
+///\r
+/// Predicts the time at which the given frame will be displayed. The predicted time\r
+/// is the middle of the time period during which the corresponding eye images will\r
+/// be displayed.\r
+///\r
+/// The application should increment frameIndex for each successively targeted frame,\r
+/// and pass that index to any relevant OVR functions that need to apply to the frame\r
+/// identified by that index.\r
+///\r
+/// This function is thread-safe and allows for multiple application threads to target\r
+/// their processing to the same displayed frame.\r
+///\r
+/// In the even that prediction fails due to various reasons (e.g. the display being off\r
+/// or app has yet to present any frames), the return value will be current CPU time.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] frameIndex Identifies the frame the caller wishes to target.\r
+/// A value of zero returns the next frame index.\r
+/// \return Returns the absolute frame midpoint time for the given frameIndex.\r
+/// \see ovr_GetTimeInSeconds\r
+///\r
+OVR_PUBLIC_FUNCTION(double) ovr_GetPredictedDisplayTime(ovrSession session, long long frameIndex);\r
+\r
+/// Returns global, absolute high-resolution time in seconds.\r
+///\r
+/// The time frame of reference for this function is not specified and should not be\r
+/// depended upon.\r
+///\r
+/// \return Returns seconds as a floating point value.\r
+/// \see ovrPoseStatef, ovrFrameTiming\r
+///\r
+OVR_PUBLIC_FUNCTION(double) ovr_GetTimeInSeconds();\r
+\r
+#endif // !defined(OVR_EXPORTING_CAPI)\r
+\r
+/// Performance HUD enables the HMD user to see information critical to\r
+/// the real-time operation of the VR application such as latency timing,\r
+/// and CPU & GPU performance metrics\r
+///\r
+/// App can toggle performance HUD modes as such:\r
+/// \code{.cpp}\r
+/// ovrPerfHudMode PerfHudMode = ovrPerfHud_LatencyTiming;\r
+/// ovr_SetInt(session, OVR_PERF_HUD_MODE, (int)PerfHudMode);\r
+/// \endcode\r
+///\r
+typedef enum ovrPerfHudMode_ {\r
+ ovrPerfHud_Off = 0, ///< Turns off the performance HUD\r
+ ovrPerfHud_PerfSummary = 1, ///< Shows performance summary and headroom\r
+ ovrPerfHud_LatencyTiming = 2, ///< Shows latency related timing info\r
+ ovrPerfHud_AppRenderTiming = 3, ///< Shows render timing info for application\r
+ ovrPerfHud_CompRenderTiming = 4, ///< Shows render timing info for OVR compositor\r
+ ovrPerfHud_AswStats = 6, ///< Shows Async Spacewarp-specific info\r
+ ovrPerfHud_VersionInfo = 5, ///< Shows SDK & HMD version Info\r
+ ovrPerfHud_Count = 7, ///< \internal Count of enumerated elements.\r
+ ovrPerfHud_EnumSize = 0x7fffffff ///< \internal Force type int32_t.\r
+} ovrPerfHudMode;\r
+\r
+/// Layer HUD enables the HMD user to see information about a layer\r
+///\r
+/// App can toggle layer HUD modes as such:\r
+/// \code{.cpp}\r
+/// ovrLayerHudMode LayerHudMode = ovrLayerHud_Info;\r
+/// ovr_SetInt(session, OVR_LAYER_HUD_MODE, (int)LayerHudMode);\r
+/// \endcode\r
+///\r
+typedef enum ovrLayerHudMode_ {\r
+ ovrLayerHud_Off = 0, ///< Turns off the layer HUD\r
+ ovrLayerHud_Info = 1, ///< Shows info about a specific layer\r
+ ovrLayerHud_EnumSize = 0x7fffffff\r
+} ovrLayerHudMode;\r
+\r
+///@}\r
+\r
+/// Debug HUD is provided to help developers gauge and debug the fidelity of their app's\r
+/// stereo rendering characteristics. Using the provided quad and crosshair guides,\r
+/// the developer can verify various aspects such as VR tracking units (e.g. meters),\r
+/// stereo camera-parallax properties (e.g. making sure objects at infinity are rendered\r
+/// with the proper separation), measuring VR geometry sizes and distances and more.\r
+///\r
+/// App can toggle the debug HUD modes as such:\r
+/// \code{.cpp}\r
+/// ovrDebugHudStereoMode DebugHudMode = ovrDebugHudStereo_QuadWithCrosshair;\r
+/// ovr_SetInt(session, OVR_DEBUG_HUD_STEREO_MODE, (int)DebugHudMode);\r
+/// \endcode\r
+///\r
+/// The app can modify the visual properties of the stereo guide (i.e. quad, crosshair)\r
+/// using the ovr_SetFloatArray function. For a list of tweakable properties,\r
+/// see the OVR_DEBUG_HUD_STEREO_GUIDE_* keys in the OVR_CAPI_Keys.h header file.\r
+typedef enum ovrDebugHudStereoMode_ {\r
+ /// Turns off the Stereo Debug HUD.\r
+ ovrDebugHudStereo_Off = 0,\r
+\r
+ /// Renders Quad in world for Stereo Debugging.\r
+ ovrDebugHudStereo_Quad = 1,\r
+\r
+ /// Renders Quad+crosshair in world for Stereo Debugging\r
+ ovrDebugHudStereo_QuadWithCrosshair = 2,\r
+\r
+ /// Renders screen-space crosshair at infinity for Stereo Debugging\r
+ ovrDebugHudStereo_CrosshairAtInfinity = 3,\r
+\r
+ /// \internal Count of enumerated elements\r
+ ovrDebugHudStereo_Count,\r
+\r
+ ovrDebugHudStereo_EnumSize = 0x7fffffff ///< \internal Force type int32_t\r
+} ovrDebugHudStereoMode;\r
+\r
+#if !defined(OVR_EXPORTING_CAPI)\r
+\r
+// -----------------------------------------------------------------------------------\r
+/// @name Property Access\r
+///\r
+/// These functions read and write OVR properties. Supported properties\r
+/// are defined in OVR_CAPI_Keys.h\r
+///\r
+//@{\r
+\r
+/// Reads a boolean property.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid for only the call.\r
+/// \param[in] defaultVal specifes the value to return if the property couldn't be read.\r
+/// \return Returns the property interpreted as a boolean value. Returns defaultVal if\r
+/// the property doesn't exist.\r
+OVR_PUBLIC_FUNCTION(ovrBool)\r
+ovr_GetBool(ovrSession session, const char* propertyName, ovrBool defaultVal);\r
+\r
+/// Writes or creates a boolean property.\r
+/// If the property wasn't previously a boolean property, it is changed to a boolean property.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid only for the call.\r
+/// \param[in] value The value to write.\r
+/// \return Returns true if successful, otherwise false. A false result should only occur if the\r
+/// property\r
+/// name is empty or if the property is read-only.\r
+OVR_PUBLIC_FUNCTION(ovrBool)\r
+ovr_SetBool(ovrSession session, const char* propertyName, ovrBool value);\r
+\r
+/// Reads an integer property.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid only for the call.\r
+/// \param[in] defaultVal Specifes the value to return if the property couldn't be read.\r
+/// \return Returns the property interpreted as an integer value. Returns defaultVal if\r
+/// the property doesn't exist.\r
+OVR_PUBLIC_FUNCTION(int) ovr_GetInt(ovrSession session, const char* propertyName, int defaultVal);\r
+\r
+/// Writes or creates an integer property.\r
+///\r
+/// If the property wasn't previously a boolean property, it is changed to an integer property.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid only for the call.\r
+/// \param[in] value The value to write.\r
+/// \return Returns true if successful, otherwise false. A false result should only occur if the\r
+/// property name is empty or if the property is read-only.\r
+OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetInt(ovrSession session, const char* propertyName, int value);\r
+\r
+/// Reads a float property.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid only for the call.\r
+/// \param[in] defaultVal specifes the value to return if the property couldn't be read.\r
+/// \return Returns the property interpreted as an float value. Returns defaultVal if\r
+/// the property doesn't exist.\r
+OVR_PUBLIC_FUNCTION(float)\r
+ovr_GetFloat(ovrSession session, const char* propertyName, float defaultVal);\r
+\r
+/// Writes or creates a float property.\r
+/// If the property wasn't previously a float property, it's changed to a float property.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid only for the call.\r
+/// \param[in] value The value to write.\r
+/// \return Returns true if successful, otherwise false. A false result should only occur if the\r
+/// property name is empty or if the property is read-only.\r
+OVR_PUBLIC_FUNCTION(ovrBool)\r
+ovr_SetFloat(ovrSession session, const char* propertyName, float value);\r
+\r
+/// Reads a float array property.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid only for the call.\r
+/// \param[in] values An array of float to write to.\r
+/// \param[in] valuesCapacity Specifies the maximum number of elements to write to the values array.\r
+/// \return Returns the number of elements read, or 0 if property doesn't exist or is empty.\r
+OVR_PUBLIC_FUNCTION(unsigned int)\r
+ovr_GetFloatArray(\r
+ ovrSession session,\r
+ const char* propertyName,\r
+ float values[],\r
+ unsigned int valuesCapacity);\r
+\r
+/// Writes or creates a float array property.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid only for the call.\r
+/// \param[in] values An array of float to write from.\r
+/// \param[in] valuesSize Specifies the number of elements to write.\r
+/// \return Returns true if successful, otherwise false. A false result should only occur if the\r
+/// property name is empty or if the property is read-only.\r
+OVR_PUBLIC_FUNCTION(ovrBool)\r
+ovr_SetFloatArray(\r
+ ovrSession session,\r
+ const char* propertyName,\r
+ const float values[],\r
+ unsigned int valuesSize);\r
+\r
+/// Reads a string property.\r
+/// Strings are UTF8-encoded and null-terminated.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid only for the call.\r
+/// \param[in] defaultVal Specifes the value to return if the property couldn't be read.\r
+/// \return Returns the string property if it exists. Otherwise returns defaultVal, which can be\r
+/// specified as NULL. The return memory is guaranteed to be valid until next call to\r
+/// ovr_GetString or until the session is destroyed, whichever occurs first.\r
+OVR_PUBLIC_FUNCTION(const char*)\r
+ovr_GetString(ovrSession session, const char* propertyName, const char* defaultVal);\r
+\r
+/// Writes or creates a string property.\r
+/// Strings are UTF8-encoded and null-terminated.\r
+///\r
+/// \param[in] session Specifies an ovrSession previously returned by ovr_Create.\r
+/// \param[in] propertyName The name of the property, which needs to be valid only for the call.\r
+/// \param[in] value The string property, which only needs to be valid for the duration of the call.\r
+/// \return Returns true if successful, otherwise false. A false result should only occur if the\r
+/// property name is empty or if the property is read-only.\r
+OVR_PUBLIC_FUNCTION(ovrBool)\r
+ovr_SetString(ovrSession session, const char* propertyName, const char* value);\r
+\r
+///@}\r
+\r
+#endif // !defined(OVR_EXPORTING_CAPI)\r
+\r
+#ifdef __cplusplus\r
+} // extern "C"\r
+#endif\r
+\r
+#if defined(_MSC_VER)\r
+#pragma warning(pop)\r
+#endif\r
+\r
+/// @cond DoxygenIgnore\r
+\r
+\r
+OVR_STATIC_ASSERT(\r
+ sizeof(ovrTextureSwapChainDesc) == 10 * 4,\r
+ "ovrTextureSwapChainDesc size mismatch");\r
+\r
+// -----------------------------------------------------------------------------------\r
+// ***** Backward compatibility #includes\r
+//\r
+// This is at the bottom of this file because the following is dependent on the\r
+// declarations above.\r
+\r
+#if !defined(OVR_CAPI_NO_UTILS)\r
+#include "Extras/OVR_CAPI_Util.h"\r
+#endif\r
+\r
+/// @endcond\r
+\r
+#endif // OVR_CAPI_h\r