| ovrHmdDesc | ovr_GetHmdDesc ( ovrSession session ) Returns information about the current HMD. |
| unsigned int | ovr_GetTrackerCount ( ovrSession session ) Returns the number of attached trackers. |
| ovrTrackerDesc | Returns a given attached tracker description. |
| ovrResult | Creates a handle to a VR session. |
| void | ovr_Destroy ( ovrSession session ) Destroys the session. |
| ovrResult | Returns status information for the application. |
| ovrResult | Sets the tracking origin type. |
| ovrTrackingOrigin | ovr_GetTrackingOriginType ( ovrSession session ) Gets the tracking origin state. |
| ovrResult | ovr_RecenterTrackingOrigin ( ovrSession session ) Re-centers the sensor position and orientation. |
| ovrResult | Allows manually tweaking the sensor position and orientation. |
| void | ovr_ClearShouldRecenterFlag ( ovrSession session ) Clears the ShouldRecenter status bit in ovrSessionStatus. |
| ovrTrackingState | Returns tracking state reading based on the specified absolute system time. |
| ovrResult | ovr_GetDevicePoses ( ovrSession session, ovrTrackedDeviceType * deviceTypes, int deviceCount, double absTime, ovrPoseStatef * outDevicePoses ) Returns an array of poses, where each pose matches a device type provided by the deviceTypes array parameter. |
| ovrTrackerPose | Returns the ovrTrackerPose for the given attached tracker. |
| ovrResult | ovr_GetInputState ( ovrSession session, ovrControllerType controllerType, ovrInputState * inputState ) Returns the most recent input state for controllers, without positional tracking info. |
| unsigned int | ovr_GetConnectedControllerTypes ( ovrSession session ) Returns controller types connected to the system OR'ed together. |
| ovrTouchHapticsDesc | Gets information about Haptics engine for the specified Touch controller. |
| ovrResult | ovr_SetControllerVibration ( ovrSession session, ovrControllerType controllerType, float frequency, float amplitude ) Sets constant vibration (with specified frequency and amplitude) to a controller. |
| ovrResult | ovr_SubmitControllerVibration ( ovrSession session, ovrControllerType controllerType, const ovrHapticsBuffer * buffer ) Submits a Haptics buffer (used for vibration) to Touch (only) controllers. |
| ovrResult | ovr_GetControllerVibrationState ( ovrSession session, ovrControllerType controllerType, ovrHapticsPlaybackState * outState ) Gets the Haptics engine playback state of a specific Touch controller. |
| ovrResult | ovr_TestBoundary ( ovrSession session, ovrTrackedDeviceType deviceBitmask, ovrBoundaryType boundaryType, ovrBoundaryTestResult * outTestResult ) Tests collision/proximity of position tracked devices (e.g. |
| ovrResult | ovr_TestBoundaryPoint ( ovrSession session, const ovrVector3f * point, ovrBoundaryType singleBoundaryType, ovrBoundaryTestResult * outTestResult ) Tests collision/proximity of a 3D point against the Boundary System. |
| ovrResult | Sets the look and feel of the Boundary System. |
| ovrResult | ovr_ResetBoundaryLookAndFeel ( ovrSession session ) Resets the look and feel of the Boundary System to its default state. |
| ovrResult | ovr_GetBoundaryGeometry ( ovrSession session, ovrBoundaryType boundaryType, ovrVector3f * outFloorPoints, int * outFloorPointsCount ) Gets the geometry of the Boundary System's "play area" or "outer boundary" as 3D floor points. |
| ovrResult | ovr_GetBoundaryDimensions ( ovrSession session, ovrBoundaryType boundaryType, ovrVector3f * outDimensions ) Gets the dimension of the Boundary System's "play area" or "outer boundary". |
| ovrResult | Returns if the boundary is currently visible. |
| ovrResult | Requests boundary to be visible. |
| enum | @0 { @0.ovrMaxLayerCount = 16 } Specifies the maximum number of layers supported by ovr_SubmitFrame. |
| enum | ovrLayerType { ovrLayerType.ovrLayerType_Disabled = 0, ovrLayerType.ovrLayerType_EyeFov = 1, ovrLayerType.ovrLayerType_Quad = 3, ovrLayerType.ovrLayerType_EyeMatrix = 5, ovrLayerType.ovrLayerType_EnumSize = 0x7fffffff } Describes layer types that can be passed to ovr_SubmitFrame. |
| enum | ovrLayerFlags { ovrLayerFlags.ovrLayerFlag_HighQuality = 0x01, ovrLayerFlags.ovrLayerFlag_TextureOriginAtBottomLeft = 0x02, ovrLayerFlags.ovrLayerFlag_HeadLocked = 0x04 } Identifies flags used by ovrLayerHeader and which are passed to ovr_SubmitFrame. |
| ovrResult | TextureSwapChain creation is rendering API-specific. |
| ovrResult | ovr_GetTextureSwapChainCurrentIndex ( ovrSession session, ovrTextureSwapChain chain, int * out_Index ) Gets the current index in an ovrTextureSwapChain. |
| ovrResult | ovr_GetTextureSwapChainDesc ( ovrSession session, ovrTextureSwapChain chain, ovrTextureSwapChainDesc * out_Desc ) Gets the description of the buffers in an ovrTextureSwapChain. |
| ovrResult | Commits any pending changes to an ovrTextureSwapChain, and advances its current index. |
| void | Destroys an ovrTextureSwapChain and frees all the resources associated with it. |
| void | MirrorTexture creation is rendering API-specific. |
| ovrSizei | ovr_GetFovTextureSize ( ovrSession session, ovrEyeType eye, ovrFovPort fov, float pixelsPerDisplayPixel ) Calculates the recommended viewport size for rendering a given eye within the HMD with a given FOV cone. |
| ovrEyeRenderDesc | Computes the distortion viewport, view adjust, and other rendering parameters for the specified eye. |
| ovrResult | ovr_SubmitFrame ( ovrSession session, long long frameIndex, const ovrViewScaleDesc * viewScaleDesc, ovrLayerHeader const *const * layerPtrList, unsigned int layerCount ) Submits layers for distortion and display. |
| enum | @1 { } Maximum number of frames of performance stats provided back to the caller of ovr_GetPerfStats. |
| enum | ovrPerfHudMode { ovrPerfHudMode.ovrPerfHud_Off = 0, ovrPerfHudMode.ovrPerfHud_PerfSummary = 1, ovrPerfHudMode.ovrPerfHud_LatencyTiming = 2, ovrPerfHudMode.ovrPerfHud_AppRenderTiming = 3, ovrPerfHudMode.ovrPerfHud_CompRenderTiming = 4, ovrPerfHudMode.ovrPerfHud_AswStats = 6, ovrPerfHudMode.ovrPerfHud_VersionInfo = 5, ovrPerfHudMode.ovrPerfHud_Count = 7, ovrPerfHudMode.ovrPerfHud_EnumSize = 0x7fffffff } Performance HUD enables the HMD user to see information critical to the real-time operation of the VR application such as latency timing, and CPU & GPU performance metrics. |
| enum | ovrLayerHudMode { ovrLayerHudMode.ovrLayerHud_Off = 0, ovrLayerHudMode.ovrLayerHud_Info = 1, ovrLayerHudMode.ovrLayerHud_EnumSize = 0x7fffffff } Layer HUD enables the HMD user to see information about a layer. |
| ovrResult | Retrieves performance stats for the VR app as well as the SDK compositor. |
| ovrResult | ovr_ResetPerfStats ( ovrSession session ) Resets the accumulated stats reported in each ovrPerfStatsPerCompositorFrame back to zero. |
| double | Gets the time of the specified frame midpoint. |
| double | Returns global, absolute high-resolution time in seconds. |
| ovrResult | ovr_GetExternalCameras ( ovrSession session, ovrExternalCamera * cameras, unsigned int * inoutCameraCount ) Returns the number of camera properties of all cameras. |
| ovrResult | ovr_SetExternalCameraProperties ( ovrSession session, const char * name, const ovrCameraIntrinsics *const intrinsics, const ovrCameraExtrinsics *const extrinsics ) Sets the camera intrinsics and/or extrinsics stored for the cameraName camera Names must be < 32 characters and null-terminated. |
| ovrBool | Reads a boolean property. |
| ovrBool | Writes or creates a boolean property. |
| int | Reads an integer property. |
| ovrBool | Writes or creates an integer property. |
| float | Reads a float property. |
| ovrBool | Writes or creates a float property. |
| unsigned int | ovr_GetFloatArray ( ovrSession session, const char * propertyName, float values, unsigned int valuesCapacity ) Reads a float array property. |
| ovrBool | ovr_SetFloatArray ( ovrSession session, const char * propertyName, const float values, unsigned int valuesSize ) Writes or creates a float array property. |
| const char * | Reads a string property. |
| ovrBool | Writes or creates a string property. |
| #define | OVR_OS_WIN32 |
| #define | OVR_CDECL LibOVR calling convention for 32-bit Windows builds. |
| #define | OVR_EXTERN_C Defined as extern "C" when built from C++ code. |
| #define | OVR_CC_HAS_FEATURE Provided for backward compatibility with older versions of this library. |
| #define | OVR_SA_UNUSED |
| #define | OVR_SA_PASTE |
| #define | OVR_SA_HELP |
| #define | OVR_STATIC_ASSERT |
| #define | OVR_UNUSED_STRUCT_PAD Defines explicitly unused space for a struct. |
| #define | OVR_PTR_SIZE Specifies the size of a pointer on the given platform. |
| #define | OVR_ON32 |
| #define | OVR_ON64 |
| #define | ovrFalse ovrBool value of false. |
| #define | ovrTrue ovrBool value of true. |
| #define | VK_DEFINE_HANDLE Fallback definitions for when the vulkan header isn't being included. |
| #define | VK_DEFINE_NON_DISPATCHABLE_HANDLE |
| #define | OVR_HAPTICS_BUFFER_SAMPLES_MAX Maximum number of samples in ovrHapticsBuffer. |
| #define | OVR_EXTERNAL_CAMERA_NAME_SIZE |
| char | ovrBool ( ) Boolean type. |
| struct ovrHmdStruct * | ovrSession ( ) Used as an opaque pointer to an OVR session. |
| uint32_t | ovrProcessId ( ) |
| struct ovrTextureSwapChainData * | |
| struct ovrMirrorTextureData * | ovrMirrorTexture ( ) |
| void(OVR_CDECL * | ovrLogCallback ( ) Signature of the logging callback function pointer type. |
| ovrResult | ovr_Initialize ( const ovrInitParams * params ) Initializes LibOVR. |
| void | ovr_Shutdown ( ) Shuts down LibOVR. |
| void | ovr_GetLastErrorInfo ( ovrErrorInfo * errorInfo ) Returns information about the most recent failed return value by the current thread for this library. |
| const char * | Returns the version string representing the LibOVRRT version. |
| int | Writes a message string to the LibOVR tracing mechanism (if enabled). |
| ovrResult | ovr_IdentifyClient ( const char * identity ) Identify client application info. |
| ovrLayerType_Disabled | Layer is disabled. |
| ovrLayerType_EyeFov | Described by ovrLayerEyeFov. |
| ovrLayerType_Quad | Described by ovrLayerQuad. Previously called ovrLayerType_QuadInWorld. |
| ovrLayerType_EyeMatrix | Described by ovrLayerEyeMatrix. |
| ovrLayerType_EnumSize | Force type int32_t. |
| ovrTexture_2D | 2D textures. |
| ovrTexture_2D_External | Application-provided 2D texture. Not supported on PC. |
| ovrTexture_Cube | Cube maps. ovrTextureSwapChainDesc::ArraySize must be 6 for this type. |
| ovrTexture_Count | |
| ovrTexture_EnumSize | = 0x7fffffff |
/************************************************************************************
\file OVR_CAPI.h
\brief C Interface to the Oculus PC SDK tracking and rendering library.
\copyright Copyright 2014 Oculus VR, LLC All Rights reserved.
************************************************************************************/
// We don't use version numbers within OVR_CAPI_h, as all versioned variations
// of this file are currently mutually exclusive.
#ifndef OVR_CAPI_h
#define OVR_CAPI_h
#include "OVR_CAPI_Keys.h"
#include "OVR_Version.h"
#include "OVR_ErrorCode.h"
#if !defined(_WIN32)
#include <sys/types.h>
#endif
#include <stdint.h>
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4324) // structure was padded due to __declspec(align())
#pragma warning(disable : 4359) // The alignment specified for a type is less than the
// alignment of the type of one of its data members
#endif
//-----------------------------------------------------------------------------------
// ***** OVR_OS
//
#if !defined(OVR_OS_WIN32) && defined(_WIN32)
#define OVR_OS_WIN32
#endif
#if !defined(OVR_OS_MAC) && defined(__APPLE__)
#define OVR_OS_MAC
#endif
#if !defined(OVR_OS_LINUX) && defined(__linux__)
#define OVR_OS_LINUX
#endif
//-----------------------------------------------------------------------------------
// ***** OVR_CPP
//
#if !defined(OVR_CPP)
#if defined(__cplusplus)
#define OVR_CPP(x) x
#else
#define OVR_CPP(x) /* Not C++ */
#endif
#endif
//-----------------------------------------------------------------------------------
// ***** OVR_CDECL
//
//
#if !defined(OVR_CDECL)
#if defined(_WIN32)
#define OVR_CDECL __cdecl
#else
#define OVR_CDECL
#endif
#endif
//-----------------------------------------------------------------------------------
// ***** OVR_EXTERN_C
//
//
#if !defined(OVR_EXTERN_C)
#ifdef __cplusplus
#define OVR_EXTERN_C extern "C"
#else
#define OVR_EXTERN_C
#endif
#endif
//-----------------------------------------------------------------------------------
// ***** OVR_PUBLIC_FUNCTION / OVR_PRIVATE_FUNCTION
//
// OVR_PUBLIC_FUNCTION - Functions that externally visible from a shared library.
// Corresponds to Microsoft __dllexport.
// OVR_PUBLIC_CLASS - C++ structs and classes that are externally visible from a
// shared library. Corresponds to Microsoft __dllexport.
// OVR_PRIVATE_FUNCTION - Functions that are not visible outside of a shared library.
// They are private to the shared library.
// OVR_PRIVATE_CLASS - C++ structs and classes that are not visible outside of a
// shared library. They are private to the shared library.
//
// OVR_DLL_BUILD - Used to indicate that the current compilation unit is of a shared library.
// OVR_DLL_IMPORT - Used to indicate that the current compilation unit is a
// user of the corresponding shared library.
// OVR_STATIC_BUILD - used to indicate that the current compilation unit is not a
// shared library but rather statically linked code.
//
#if !defined(OVR_PUBLIC_FUNCTION)
#if defined(OVR_DLL_BUILD)
#if defined(_WIN32)
#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C __declspec(dllexport) rval OVR_CDECL
#define OVR_PUBLIC_CLASS __declspec(dllexport)
#define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL
#define OVR_PRIVATE_CLASS
#else
#define OVR_PUBLIC_FUNCTION(rval) \
OVR_EXTERN_C __attribute__((visibility("default"))) rval OVR_CDECL /* Requires GCC 4.0+ */
#define OVR_PUBLIC_CLASS __attribute__((visibility("default"))) /* Requires GCC 4.0+ */
#define OVR_PRIVATE_FUNCTION(rval) __attribute__((visibility("hidden"))) rval OVR_CDECL
#define OVR_PRIVATE_CLASS __attribute__((visibility("hidden")))
#endif
#elif defined(OVR_DLL_IMPORT)
#if defined(_WIN32)
#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C __declspec(dllimport) rval OVR_CDECL
#define OVR_PUBLIC_CLASS __declspec(dllimport)
#else
#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C rval OVR_CDECL
#define OVR_PUBLIC_CLASS
#endif
#define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL
#define OVR_PRIVATE_CLASS
#else // OVR_STATIC_BUILD
#define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C rval OVR_CDECL
#define OVR_PUBLIC_CLASS
#define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL
#define OVR_PRIVATE_CLASS
#endif
#endif
//-----------------------------------------------------------------------------------
// ***** OVR_EXPORT
//
//
#if !defined(OVR_EXPORT)
#ifdef OVR_OS_WIN32
#define OVR_EXPORT __declspec(dllexport)
#else
#define OVR_EXPORT
#endif
#endif
//-----------------------------------------------------------------------------------
// ***** OVR_ALIGNAS
//
#if !defined(OVR_ALIGNAS)
#if defined(__GNUC__) || defined(__clang__)
#define OVR_ALIGNAS(n) __attribute__((aligned(n)))
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
#define OVR_ALIGNAS(n) __declspec(align(n))
#elif defined(__CC_ARM)
#define OVR_ALIGNAS(n) __align(n)
#else
#error Need to define OVR_ALIGNAS
#endif
#endif
//-----------------------------------------------------------------------------------
// ***** OVR_CC_HAS_FEATURE
//
// This is a portable way to use compile-time feature identification available
// with some compilers in a clean way. Direct usage of __has_feature in preprocessing
// statements of non-supporting compilers results in a preprocessing error.
//
// Example usage:
// #if OVR_CC_HAS_FEATURE(is_pod)
// if(__is_pod(T)) // If the type is plain data then we can safely memcpy it.
// memcpy(&destObject, &srcObject, sizeof(object));
// #endif
//
#if !defined(OVR_CC_HAS_FEATURE)
#if defined(__clang__) // http://clang.llvm.org/docs/LanguageExtensions.html#id2
#define OVR_CC_HAS_FEATURE(x) __has_feature(x)
#else
#define OVR_CC_HAS_FEATURE(x) 0
#endif
#endif
// ------------------------------------------------------------------------
// ***** OVR_STATIC_ASSERT
//
// Portable support for C++11 static_assert().
// Acts as if the following were declared:
// void OVR_STATIC_ASSERT(bool const_expression, const char* msg);
//
// Example usage:
// OVR_STATIC_ASSERT(sizeof(int32_t) == 4, "int32_t expected to be 4 bytes.");
#if !defined(OVR_STATIC_ASSERT)
#if !(defined(__cplusplus) && (__cplusplus >= 201103L)) /* Other */ && \
!(defined(__GXX_EXPERIMENTAL_CXX0X__)) /* GCC */ && \
!(defined(__clang__) && defined(__cplusplus) && \
OVR_CC_HAS_FEATURE(cxx_static_assert)) /* clang */ \
&& !(defined(_MSC_VER) && (_MSC_VER >= 1600) && defined(__cplusplus)) /* VS2010+ */
#if !defined(OVR_SA_UNUSED)
#if defined(OVR_CC_GNU) || defined(OVR_CC_CLANG)
#define OVR_SA_UNUSED __attribute__((unused))
#else
#define OVR_SA_UNUSED
#endif
#define OVR_SA_PASTE(a, b) a##b
#define OVR_SA_HELP(a, b) OVR_SA_PASTE(a, b)
#endif
#if defined(__COUNTER__)
#define OVR_STATIC_ASSERT(expression, msg) \
typedef char OVR_SA_HELP(staticAssert, __COUNTER__)[((expression) != 0) ? 1 : -1] OVR_SA_UNUSED
#else
#define OVR_STATIC_ASSERT(expression, msg) \
typedef char OVR_SA_HELP(staticAssert, __LINE__)[((expression) != 0) ? 1 : -1] OVR_SA_UNUSED
#endif
#else
#define OVR_STATIC_ASSERT(expression, msg) static_assert(expression, msg)
#endif
#endif
//-----------------------------------------------------------------------------------
// ***** Padding
//
#if !defined(OVR_UNUSED_STRUCT_PAD)
#define OVR_UNUSED_STRUCT_PAD(padName, size) char padName[size];
#endif
//-----------------------------------------------------------------------------------
// ***** Word Size
//
#if !defined(OVR_PTR_SIZE)
#if defined(__WORDSIZE)
#define OVR_PTR_SIZE ((__WORDSIZE) / 8)
#elif defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(_M_IA64) || \
defined(__ia64__) || defined(__arch64__) || defined(__64BIT__) || defined(__Ptr_Is_64)
#define OVR_PTR_SIZE 8
#elif defined(__CC_ARM) && (__sizeof_ptr == 8)
#define OVR_PTR_SIZE 8
#else
#define OVR_PTR_SIZE 4
#endif
#endif
//-----------------------------------------------------------------------------------
// ***** OVR_ON32 / OVR_ON64
//
#if OVR_PTR_SIZE == 8
#define OVR_ON32(x)
#define OVR_ON64(x) x
#else
#define OVR_ON32(x) x
#define OVR_ON64(x)
#endif
//-----------------------------------------------------------------------------------
// ***** ovrBool
typedefchar ovrBool;
#define ovrFalse 0
#define ovrTrue 1
//-----------------------------------------------------------------------------------
// ***** Simple Math Structures
typedefstruct OVR_ALIGNAS(4) ovrColorf_ { float r, g, b, a; } ovrColorf;
typedefstruct OVR_ALIGNAS(4) ovrVector2i_ { int x, y; } ovrVector2i;
typedefstruct OVR_ALIGNAS(4) ovrSizei_ { int w, h; } ovrSizei;
typedefstruct OVR_ALIGNAS(4) ovrRecti_ {
ovrVector2i Pos;
ovrSizei Size;
} ovrRecti;
typedefstruct OVR_ALIGNAS(4) ovrQuatf_ { float x, y, z, w; } ovrQuatf;
typedefstruct OVR_ALIGNAS(4) ovrVector2f_ { float x, y; } ovrVector2f;
typedefstruct OVR_ALIGNAS(4) ovrVector3f_ { float x, y, z; } ovrVector3f;
typedefstruct OVR_ALIGNAS(4) ovrMatrix4f_ { float M[4][4]; } ovrMatrix4f;
typedefstruct OVR_ALIGNAS(4) ovrPosef_ {
ovrQuatf Orientation;
ovrVector3f Position;
} ovrPosef;
typedefstruct OVR_ALIGNAS(8) ovrPoseStatef_ {
ovrPosef ThePose;
ovrVector3f AngularVelocity;
ovrVector3f LinearVelocity;
ovrVector3f AngularAcceleration;
ovrVector3f LinearAcceleration;
OVR_UNUSED_STRUCT_PAD(pad0, 4)
double TimeInSeconds;
} ovrPoseStatef;
typedef struct OVR_ALIGNAS(4) ovrFovPort_ {
float UpTan;
float DownTan;
float LeftTan;
float RightTan;
} ovrFovPort;
//-----------------------------------------------------------------------------------
// ***** HMD Types
typedefenum ovrHmdType_ {
ovrHmd_None = 0,
ovrHmd_DK1 = 3,
ovrHmd_DKHD = 4,
ovrHmd_DK2 = 6,
ovrHmd_CB = 8,
ovrHmd_Other = 9,
ovrHmd_E3_2015 = 10,
ovrHmd_ES06 = 11,
ovrHmd_ES09 = 12,
ovrHmd_ES11 = 13,
ovrHmd_CV1 = 14,
ovrHmd_EnumSize = 0x7fffffff
} ovrHmdType;
typedefenum ovrHmdCaps_ {
// Read-only flags
ovrHmdCap_DebugDevice = 0x0010,
ovrHmdCap_EnumSize = 0x7fffffff
} ovrHmdCaps;
typedefenum ovrTrackingCaps_ {
ovrTrackingCap_Orientation = 0x0010,
ovrTrackingCap_MagYawCorrection = 0x0020,
ovrTrackingCap_Position = 0x0040,
ovrTrackingCap_EnumSize = 0x7fffffff
} ovrTrackingCaps;
typedefenum ovrEyeType_ {
ovrEye_Left = 0,
ovrEye_Right = 1,
ovrEye_Count = 2,
ovrEye_EnumSize = 0x7fffffff
} ovrEyeType;
typedefenum ovrTrackingOrigin_ {
ovrTrackingOrigin_EyeLevel = 0,
ovrTrackingOrigin_FloorLevel = 1,
ovrTrackingOrigin_Count = 2,
ovrTrackingOrigin_EnumSize = 0x7fffffff
} ovrTrackingOrigin;
typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrGraphicsLuid_ {
// Public definition reserves space for graphics API-specific implementation
char Reserved[8];
} ovrGraphicsLuid;
typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrHmdDesc_ {
ovrHmdType Type;
OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad0, 4))
char ProductName[64];
char Manufacturer[64];
short VendorId;
short ProductId;
char SerialNumber[24];
short FirmwareMajor;
short FirmwareMinor;
unsignedint AvailableHmdCaps;
unsignedint DefaultHmdCaps;
unsignedint AvailableTrackingCaps;
unsignedint DefaultTrackingCaps;
ovrFovPort DefaultEyeFov[ovrEye_Count];
ovrFovPort MaxEyeFov[ovrEye_Count];
ovrSizei Resolution;
float DisplayRefreshRate;
OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad1, 4))
} ovrHmdDesc;
typedef struct ovrHmdStruct* ovrSession;
#ifdef OVR_OS_WIN32
typedef uint32_t ovrProcessId;
#else
typedef pid_t ovrProcessId;
#endif
#if !defined(VK_VERSION_1_0)
// From <vulkan/vulkan.h>:
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || \
defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || \
defined(__powerpc64__)
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T* object;
#else
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
#endif
VK_DEFINE_HANDLE(VkInstance)
VK_DEFINE_HANDLE(VkPhysicalDevice)
VK_DEFINE_HANDLE(VkDevice)
VK_DEFINE_HANDLE(VkQueue)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage)
#endif
typedefenum ovrStatusBits_ {
ovrStatus_OrientationTracked = 0x0001,
ovrStatus_PositionTracked = 0x0002,
ovrStatus_EnumSize = 0x7fffffff
} ovrStatusBits;
typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTrackerDesc_ {
float FrustumHFovInRadians;
float FrustumVFovInRadians;
float FrustumNearZInMeters;
float FrustumFarZInMeters;
} ovrTrackerDesc;
typedefenum ovrTrackerFlags_ {
ovrTracker_Connected = 0x0020,
ovrTracker_PoseTracked = 0x0004
} ovrTrackerFlags;
typedefstruct OVR_ALIGNAS(8) _ovrTrackerPose {
unsignedint TrackerFlags;
ovrPosef Pose;
ovrPosef LeveledPose;
OVR_UNUSED_STRUCT_PAD(pad0, 4)
} ovrTrackerPose;
typedefstruct OVR_ALIGNAS(8) ovrTrackingState_ {
ovrPoseStatef HeadPose;
unsignedint StatusFlags;
ovrPoseStatef HandPoses[2];
unsignedint HandStatusFlags[2];
ovrPosef CalibratedOrigin;
} ovrTrackingState;
typedefstruct OVR_ALIGNAS(4) ovrEyeRenderDesc_ {
ovrEyeType Eye;
ovrFovPort Fov;
ovrRecti DistortedViewport;
ovrVector2f PixelsPerTanAngleAtCenter;
ovrPosef HmdToEyePose;
} ovrEyeRenderDesc;
typedefstruct OVR_ALIGNAS(4) ovrTimewarpProjectionDesc_ {
float Projection22;
float Projection23;
float Projection32;
} ovrTimewarpProjectionDesc;
typedefstruct OVR_ALIGNAS(4) ovrViewScaleDesc_ {
ovrPosef HmdToEyePose[ovrEye_Count];
float HmdSpaceToWorldScaleInMeters;
} ovrViewScaleDesc;
//-----------------------------------------------------------------------------------
// ***** Platform-independent Rendering Configuration
typedefenum ovrTextureType_ {
ovrTexture_2D,
ovrTexture_2D_External,
ovrTexture_Cube,
ovrTexture_Count,
ovrTexture_EnumSize = 0x7fffffff
} ovrTextureType;
typedefenum ovrTextureBindFlags_ {
ovrTextureBind_None,
ovrTextureBind_DX_RenderTarget = 0x0001,
ovrTextureBind_DX_UnorderedAccess = 0x0002,
ovrTextureBind_DX_DepthStencil = 0x0004,
ovrTextureBind_EnumSize = 0x7fffffff
} ovrTextureBindFlags;
typedefenum ovrTextureFormat_ {
OVR_FORMAT_UNKNOWN = 0,
OVR_FORMAT_B5G6R5_UNORM = 1,
OVR_FORMAT_B5G5R5A1_UNORM = 2,
OVR_FORMAT_B4G4R4A4_UNORM = 3,
OVR_FORMAT_R8G8B8A8_UNORM = 4,
OVR_FORMAT_R8G8B8A8_UNORM_SRGB = 5,
OVR_FORMAT_B8G8R8A8_UNORM = 6,
OVR_FORMAT_B8G8R8A8_UNORM_SRGB = 7,
OVR_FORMAT_B8G8R8X8_UNORM = 8,
OVR_FORMAT_B8G8R8X8_UNORM_SRGB = 9,
OVR_FORMAT_R16G16B16A16_FLOAT = 10,
OVR_FORMAT_R11G11B10_FLOAT = 25,
// Depth formats
OVR_FORMAT_D16_UNORM = 11,
OVR_FORMAT_D24_UNORM_S8_UINT = 12,
OVR_FORMAT_D32_FLOAT = 13,
OVR_FORMAT_D32_FLOAT_S8X24_UINT = 14,
// Added in 1.5 compressed formats can be used for static layers
OVR_FORMAT_BC1_UNORM = 15,
OVR_FORMAT_BC1_UNORM_SRGB = 16,
OVR_FORMAT_BC2_UNORM = 17,
OVR_FORMAT_BC2_UNORM_SRGB = 18,
OVR_FORMAT_BC3_UNORM = 19,
OVR_FORMAT_BC3_UNORM_SRGB = 20,
OVR_FORMAT_BC6H_UF16 = 21,
OVR_FORMAT_BC6H_SF16 = 22,
OVR_FORMAT_BC7_UNORM = 23,
OVR_FORMAT_BC7_UNORM_SRGB = 24,
OVR_FORMAT_ENUMSIZE = 0x7fffffff
} ovrTextureFormat;
typedefenum ovrTextureMiscFlags_ {
ovrTextureMisc_None,
ovrTextureMisc_DX_Typeless = 0x0001,
ovrTextureMisc_AllowGenerateMips = 0x0002,
ovrTextureMisc_ProtectedContent = 0x0004,
ovrTextureMisc_EnumSize = 0x7fffffff
} ovrTextureFlags;
typedefstruct ovrTextureSwapChainDesc_ {
ovrTextureType Type;
ovrTextureFormat Format;
int ArraySize;
int Width;
int Height;
int MipLevels;
int SampleCount;
ovrBool StaticImage;
unsignedint MiscFlags;
unsignedint BindFlags;
} ovrTextureSwapChainDesc;
typedefstruct ovrMirrorTextureDesc_ {
ovrTextureFormat Format;
int Width;
int Height;
unsignedint MiscFlags;
unsignedint MirrorOptions;
} ovrMirrorTextureDesc;
typedefstruct ovrTextureSwapChainData* ovrTextureSwapChain;
typedefstruct ovrMirrorTextureData* ovrMirrorTexture;
//-----------------------------------------------------------------------------------
typedefenum ovrButton_ {
ovrButton_A = 0x00000001,
ovrButton_B = 0x00000002,
ovrButton_RThumb = 0x00000004,
ovrButton_RShoulder = 0x00000008,
ovrButton_X = 0x00000100,
ovrButton_Y = 0x00000200,
ovrButton_LThumb = 0x00000400,
ovrButton_LShoulder = 0x00000800,
ovrButton_Up = 0x00010000,
ovrButton_Down = 0x00020000,
ovrButton_Left = 0x00040000,
ovrButton_Right = 0x00080000,
ovrButton_Enter = 0x00100000,
ovrButton_Back = 0x00200000,
ovrButton_VolUp = 0x00400000,
ovrButton_VolDown = 0x00800000,
ovrButton_Home = 0x01000000,
// Bit mask of all buttons that are for private usage by Oculus
ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home,
// Bit mask of all buttons on the right Touch controller
ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder,
// Bit mask of all buttons on the left Touch controller
ovrButton_LMask =
ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder | ovrButton_Enter,
ovrButton_EnumSize = 0x7fffffff
} ovrButton;
typedefenum ovrTouch_ {
ovrTouch_A = ovrButton_A,
ovrTouch_B = ovrButton_B,
ovrTouch_RThumb = ovrButton_RThumb,
ovrTouch_RThumbRest = 0x00000008,
ovrTouch_RIndexTrigger = 0x00000010,
// Bit mask of all the button touches on the right controller
ovrTouch_RButtonMask =
ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RThumbRest | ovrTouch_RIndexTrigger,
ovrTouch_X = ovrButton_X,
ovrTouch_Y = ovrButton_Y,
ovrTouch_LThumb = ovrButton_LThumb,
ovrTouch_LThumbRest = 0x00000800,
ovrTouch_LIndexTrigger = 0x00001000,
// Bit mask of all the button touches on the left controller
ovrTouch_LButtonMask =
ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger,
// Finger pose state
// Derived internally based on distance, proximity to sensors and filtering.
ovrTouch_RIndexPointing = 0x00000020,
ovrTouch_RThumbUp = 0x00000040,
ovrTouch_LIndexPointing = 0x00002000,
ovrTouch_LThumbUp = 0x00004000,
// Bit mask of all right controller poses
ovrTouch_RPoseMask = ovrTouch_RIndexPointing | ovrTouch_RThumbUp,
// Bit mask of all left controller poses
ovrTouch_LPoseMask = ovrTouch_LIndexPointing | ovrTouch_LThumbUp,
ovrTouch_EnumSize = 0x7fffffff
} ovrTouch;
typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTouchHapticsDesc_ {
// Haptics engine frequency/sample-rate, sample time in seconds equals 1.0/sampleRateHz
int SampleRateHz;
// Size of each Haptics sample, sample value range is [0, 2^(Bytes*8)-1]
int SampleSizeInBytes;
// Queue size that would guarantee Haptics engine would not starve for data
// Make sure size doesn't drop below it for best results
int QueueMinSizeToAvoidStarvation;
// Minimum, Maximum and Optimal number of samples that can be sent to Haptics through
// ovr_SubmitControllerVibration
int SubmitMinSamples;
int SubmitMaxSamples;
int SubmitOptimalSamples;
} ovrTouchHapticsDesc;
typedefenum ovrControllerType_ {
ovrControllerType_None = 0x0000,
ovrControllerType_LTouch = 0x0001,
ovrControllerType_RTouch = 0x0002,
ovrControllerType_Touch = (ovrControllerType_LTouch | ovrControllerType_RTouch),
ovrControllerType_Remote = 0x0004,
ovrControllerType_XBox = 0x0010,
ovrControllerType_Object0 = 0x0100,
ovrControllerType_Object1 = 0x0200,
ovrControllerType_Object2 = 0x0400,
ovrControllerType_Object3 = 0x0800,
ovrControllerType_Active = 0xffffffff,
ovrControllerType_EnumSize = 0x7fffffff
} ovrControllerType;
typedefenum ovrHapticsBufferSubmitMode_ {
ovrHapticsBufferSubmit_Enqueue
} ovrHapticsBufferSubmitMode;
#define OVR_HAPTICS_BUFFER_SAMPLES_MAX 256
typedefstruct ovrHapticsBuffer_ {
constvoid* Samples;
int SamplesCount;
ovrHapticsBufferSubmitMode SubmitMode;
} ovrHapticsBuffer;
typedefstruct ovrHapticsPlaybackState_ {
// Remaining space available to queue more samples
int RemainingQueueSpace;
// Number of samples currently queued
int SamplesQueued;
} ovrHapticsPlaybackState;
typedefenum ovrTrackedDeviceType_ {
ovrTrackedDevice_None = 0x0000,
ovrTrackedDevice_HMD = 0x0001,
ovrTrackedDevice_LTouch = 0x0002,
ovrTrackedDevice_RTouch = 0x0004,
ovrTrackedDevice_Touch = (ovrTrackedDevice_LTouch | ovrTrackedDevice_RTouch),
ovrTrackedDevice_Object0 = 0x0010,
ovrTrackedDevice_Object1 = 0x0020,
ovrTrackedDevice_Object2 = 0x0040,
ovrTrackedDevice_Object3 = 0x0080,
ovrTrackedDevice_All = 0xFFFF,
} ovrTrackedDeviceType;
typedefenum ovrBoundaryType_ {
ovrBoundary_Outer = 0x0001,
ovrBoundary_PlayArea = 0x0100,
} ovrBoundaryType;
typedefstruct ovrBoundaryLookAndFeel_ {
ovrColorf Color;
} ovrBoundaryLookAndFeel;
typedefstruct ovrBoundaryTestResult_ {
ovrBool IsTriggering;
float ClosestDistance;
ovrVector3f ClosestPoint;
ovrVector3f ClosestPointNormal;
} ovrBoundaryTestResult;
typedefenum ovrHandType_ {
ovrHand_Left = 0,
ovrHand_Right = 1,
ovrHand_Count = 2,
ovrHand_EnumSize = 0x7fffffff
} ovrHandType;
typedefstruct ovrInputState_ {
double TimeInSeconds;
unsignedint Buttons;
unsignedint Touches;
float IndexTrigger[ovrHand_Count];
float HandTrigger[ovrHand_Count];
ovrVector2f Thumbstick[ovrHand_Count];
ovrControllerType ControllerType;
float IndexTriggerNoDeadzone[ovrHand_Count];
float HandTriggerNoDeadzone[ovrHand_Count];
ovrVector2f ThumbstickNoDeadzone[ovrHand_Count];
float IndexTriggerRaw[ovrHand_Count];
float HandTriggerRaw[ovrHand_Count];
ovrVector2f ThumbstickRaw[ovrHand_Count];
} ovrInputState;
typedefstruct ovrCameraIntrinsics_ {
double LastChangedTime;
ovrFovPort FOVPort;
float VirtualNearPlaneDistanceMeters;
float VirtualFarPlaneDistanceMeters;
ovrSizei ImageSensorPixelResolution;
ovrMatrix4f LensDistortionMatrix;
double ExposurePeriodSeconds;
double ExposureDurationSeconds;
} ovrCameraIntrinsics;
typedefenum ovrCameraStatusFlags_ {
ovrCameraStatus_None = 0x0,
ovrCameraStatus_Connected = 0x1,
ovrCameraStatus_Calibrating = 0x2,
ovrCameraStatus_CalibrationFailed = 0x4,
ovrCameraStatus_Calibrated = 0x8,
ovrCameraStatus_EnumSize = 0x7fffffff
} ovrCameraStatusFlags;
typedefstruct ovrCameraExtrinsics_ {
double LastChangedTimeSeconds;
unsignedint CameraStatusFlags;
ovrTrackedDeviceType AttachedToDevice;
ovrPosef RelativePose;
double LastExposureTimeSeconds;
double ExposureLatencySeconds;
double AdditionalLatencySeconds;
} ovrCameraExtrinsics;
#define OVR_EXTERNAL_CAMERA_NAME_SIZE 32
typedefstruct ovrExternalCamera_ {
char Name[OVR_EXTERNAL_CAMERA_NAME_SIZE];
ovrCameraIntrinsics Intrinsics;
ovrCameraExtrinsics Extrinsics;
} ovrExternalCamera;
//-----------------------------------------------------------------------------------
// ***** Initialize structures
typedefenum ovrInitFlags_ {
ovrInit_Debug = 0x00000001,
ovrInit_RequestVersion = 0x00000004,
ovrInit_Invisible = 0x00000010,
ovrInit_MixedRendering = 0x00000020,
ovrinit_WritableBits = 0x00ffffff,
ovrInit_EnumSize = 0x7fffffff
} ovrInitFlags;
typedefenum ovrLogLevel_ {
ovrLogLevel_Debug = 0,
ovrLogLevel_Info = 1,
ovrLogLevel_Error = 2,
ovrLogLevel_EnumSize = 0x7fffffff
} ovrLogLevel;
typedef void(OVR_CDECL* ovrLogCallback)(uintptr_t userData, int level, constchar* message);
typedefstruct OVR_ALIGNAS(8) ovrInitParams_ {
uint32_t Flags;
uint32_t RequestedMinorVersion;
ovrLogCallback LogCallback;
uintptr_t UserData;
uint32_t ConnectionTimeoutMS;
OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad0, 4))
} ovrInitParams;
#ifdef __cplusplus
extern"C" {
#endif
#if !defined(OVR_EXPORTING_CAPI)
// -----------------------------------------------------------------------------------
// ***** API Interfaces
OVR_PUBLIC_FUNCTION(ovrResult) ovr_Initialize(const ovrInitParams* params);
OVR_PUBLIC_FUNCTION(void) ovr_Shutdown();
OVR_PUBLIC_FUNCTION(void) ovr_GetLastErrorInfo(ovrErrorInfo* errorInfo);
OVR_PUBLIC_FUNCTION(constchar*) ovr_GetVersionString();
OVR_PUBLIC_FUNCTION(int) ovr_TraceMessage(int level, constchar* message);
OVR_PUBLIC_FUNCTION(ovrResult) ovr_IdentifyClient(constchar* identity);
//-------------------------------------------------------------------------------------
OVR_PUBLIC_FUNCTION(ovrHmdDesc) ovr_GetHmdDesc(ovrSession session);
OVR_PUBLIC_FUNCTION(unsignedint) ovr_GetTrackerCount(ovrSession session);
OVR_PUBLIC_FUNCTION(ovrTrackerDesc)
ovr_GetTrackerDesc(ovrSession session, unsignedint trackerDescIndex);
OVR_PUBLIC_FUNCTION(ovrResult) ovr_Create(ovrSession* pSession, ovrGraphicsLuid* pLuid);
OVR_PUBLIC_FUNCTION(void) ovr_Destroy(ovrSession session);
#endif // !defined(OVR_EXPORTING_CAPI)
typedefstruct ovrSessionStatus_ {
ovrBool IsVisible;
ovrBool HmdPresent;
ovrBool HmdMounted;
ovrBool DisplayLost;
ovrBool ShouldQuit;
ovrBool ShouldRecenter;
ovrBool Internal[2];
} ovrSessionStatus;
#if !defined(OVR_EXPORTING_CAPI)
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetSessionStatus(ovrSession session, ovrSessionStatus* sessionStatus);
//-------------------------------------------------------------------------------------
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SetTrackingOriginType(ovrSession session, ovrTrackingOrigin origin);
OVR_PUBLIC_FUNCTION(ovrTrackingOrigin) ovr_GetTrackingOriginType(ovrSession session);
OVR_PUBLIC_FUNCTION(ovrResult) ovr_RecenterTrackingOrigin(ovrSession session);
OVR_PUBLIC_FUNCTION(ovrResult) ovr_SpecifyTrackingOrigin(ovrSession session, ovrPosef originPose);
OVR_PUBLIC_FUNCTION(void) ovr_ClearShouldRecenterFlag(ovrSession session);
OVR_PUBLIC_FUNCTION(ovrTrackingState)
ovr_GetTrackingState(ovrSession session, double absTime, ovrBool latencyMarker);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetDevicePoses(
ovrSession session,
ovrTrackedDeviceType* deviceTypes,
int deviceCount,
double absTime,
ovrPoseStatef* outDevicePoses);
OVR_PUBLIC_FUNCTION(ovrTrackerPose)
ovr_GetTrackerPose(ovrSession session, unsignedint trackerPoseIndex);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetInputState(ovrSession session, ovrControllerType controllerType, ovrInputState* inputState);
OVR_PUBLIC_FUNCTION(unsignedint) ovr_GetConnectedControllerTypes(ovrSession session);
OVR_PUBLIC_FUNCTION(ovrTouchHapticsDesc)
ovr_GetTouchHapticsDesc(ovrSession session, ovrControllerType controllerType);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SetControllerVibration(
ovrSession session,
ovrControllerType controllerType,
float frequency,
float amplitude);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SubmitControllerVibration(
ovrSession session,
ovrControllerType controllerType,
const ovrHapticsBuffer* buffer);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetControllerVibrationState(
ovrSession session,
ovrControllerType controllerType,
ovrHapticsPlaybackState* outState);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_TestBoundary(
ovrSession session,
ovrTrackedDeviceType deviceBitmask,
ovrBoundaryType boundaryType,
ovrBoundaryTestResult* outTestResult);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_TestBoundaryPoint(
ovrSession session,
const ovrVector3f* point,
ovrBoundaryType singleBoundaryType,
ovrBoundaryTestResult* outTestResult);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SetBoundaryLookAndFeel(ovrSession session, const ovrBoundaryLookAndFeel* lookAndFeel);
OVR_PUBLIC_FUNCTION(ovrResult) ovr_ResetBoundaryLookAndFeel(ovrSession session);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetBoundaryGeometry(
ovrSession session,
ovrBoundaryType boundaryType,
ovrVector3f* outFloorPoints,
int* outFloorPointsCount);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetBoundaryDimensions(
ovrSession session,
ovrBoundaryType boundaryType,
ovrVector3f* outDimensions);
OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetBoundaryVisible(ovrSession session, ovrBool* outIsVisible);
OVR_PUBLIC_FUNCTION(ovrResult) ovr_RequestBoundaryVisible(ovrSession session, ovrBool visible);
#endif // !defined(OVR_EXPORTING_CAPI)
//-------------------------------------------------------------------------------------
// @name Layers
//
enum { ovrMaxLayerCount = 16 };
typedefenum ovrLayerType_ {
ovrLayerType_Disabled = 0,
ovrLayerType_EyeFov = 1,
ovrLayerType_Quad = 3,
// enum 4 used to be ovrLayerType_QuadHeadLocked. Instead, use ovrLayerType_Quad with
// ovrLayerFlag_HeadLocked.
ovrLayerType_EyeMatrix = 5,
ovrLayerType_EnumSize = 0x7fffffff
} ovrLayerType;
typedefenum ovrLayerFlags_ {
ovrLayerFlag_HighQuality = 0x01,
ovrLayerFlag_TextureOriginAtBottomLeft = 0x02,
ovrLayerFlag_HeadLocked = 0x04
} ovrLayerFlags;
typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerHeader_ {
ovrLayerType Type;
unsigned Flags;
} ovrLayerHeader;
typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeFov_ {
ovrLayerHeader Header;
ovrTextureSwapChain ColorTexture[ovrEye_Count];
ovrRecti Viewport[ovrEye_Count];
ovrFovPort Fov[ovrEye_Count];
ovrPosef RenderPose[ovrEye_Count];
double SensorSampleTime;
} ovrLayerEyeFov;
typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeMatrix_ {
ovrLayerHeader Header;
ovrTextureSwapChain ColorTexture[ovrEye_Count];
ovrRecti Viewport[ovrEye_Count];
ovrPosef RenderPose[ovrEye_Count];
ovrMatrix4f Matrix[ovrEye_Count];
double SensorSampleTime;
} ovrLayerEyeMatrix;
typedefstruct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerQuad_ {
ovrLayerHeader Header;
ovrTextureSwapChain ColorTexture;
ovrRecti Viewport;
ovrPosef QuadPoseCenter;
ovrVector2f QuadSize;
} ovrLayerQuad;
typedefunion ovrLayer_Union_ {
ovrLayerHeader Header;
ovrLayerEyeFov EyeFov;
ovrLayerQuad Quad;
} ovrLayer_Union;
#if !defined(OVR_EXPORTING_CAPI)
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetTextureSwapChainLength(ovrSession session, ovrTextureSwapChain chain, int* out_Length);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetTextureSwapChainCurrentIndex(ovrSession session, ovrTextureSwapChain chain, int* out_Index);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetTextureSwapChainDesc(
ovrSession session,
ovrTextureSwapChain chain,
ovrTextureSwapChainDesc* out_Desc);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_CommitTextureSwapChain(ovrSession session, ovrTextureSwapChain chain);
OVR_PUBLIC_FUNCTION(void)
ovr_DestroyTextureSwapChain(ovrSession session, ovrTextureSwapChain chain);
OVR_PUBLIC_FUNCTION(void)
ovr_DestroyMirrorTexture(ovrSession session, ovrMirrorTexture mirrorTexture);
OVR_PUBLIC_FUNCTION(ovrSizei)
ovr_GetFovTextureSize(
ovrSession session,
ovrEyeType eye,
ovrFovPort fov,
float pixelsPerDisplayPixel);
OVR_PUBLIC_FUNCTION(ovrEyeRenderDesc)
ovr_GetRenderDesc(ovrSession session, ovrEyeType eyeType, ovrFovPort fov);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SubmitFrame(
ovrSession session,
longlong frameIndex,
const ovrViewScaleDesc* viewScaleDesc,
ovrLayerHeader const* const* layerPtrList,
unsignedint layerCount);
#endif // !defined(OVR_EXPORTING_CAPI)
//-------------------------------------------------------------------------------------
typedefstruct OVR_ALIGNAS(4) ovrPerfStatsPerCompositorFrame_ {
int HmdVsyncIndex;
int AppFrameIndex;
int AppDroppedFrameCount;
float AppMotionToPhotonLatency;
float AppQueueAheadTime;
float AppCpuElapsedTime;
float AppGpuElapsedTime;
int CompositorFrameIndex;
int CompositorDroppedFrameCount;
float CompositorLatency;
float CompositorCpuElapsedTime;
float CompositorGpuElapsedTime;
float CompositorCpuStartToGpuEndElapsedTime;
float CompositorGpuEndToVsyncElapsedTime;
ovrBool AswIsActive;
int AswActivatedToggleCount;
int AswPresentedFrameCount;
int AswFailedFrameCount;
} ovrPerfStatsPerCompositorFrame;
enum { ovrMaxProvidedFrameStats = 5 };
typedefstruct OVR_ALIGNAS(4) ovrPerfStats_ {
ovrPerfStatsPerCompositorFrame FrameStats[ovrMaxProvidedFrameStats];
int FrameStatsCount;
ovrBool AnyFrameStatsDropped;
float AdaptiveGpuPerformanceScale;
ovrBool AswIsAvailable;
ovrProcessId VisibleProcessId;
} ovrPerfStats;
#if !defined(OVR_EXPORTING_CAPI)
OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetPerfStats(ovrSession session, ovrPerfStats* outStats);
OVR_PUBLIC_FUNCTION(ovrResult) ovr_ResetPerfStats(ovrSession session);
OVR_PUBLIC_FUNCTION(double) ovr_GetPredictedDisplayTime(ovrSession session, longlong frameIndex);
OVR_PUBLIC_FUNCTION(double) ovr_GetTimeInSeconds();
#endif // !defined(OVR_EXPORTING_CAPI)
typedefenum ovrPerfHudMode_ {
ovrPerfHud_Off = 0,
ovrPerfHud_PerfSummary = 1,
ovrPerfHud_LatencyTiming = 2,
ovrPerfHud_AppRenderTiming = 3,
ovrPerfHud_CompRenderTiming = 4,
ovrPerfHud_AswStats = 6,
ovrPerfHud_VersionInfo = 5,
ovrPerfHud_Count = 7,
ovrPerfHud_EnumSize = 0x7fffffff
} ovrPerfHudMode;
typedefenum ovrLayerHudMode_ {
ovrLayerHud_Off = 0,
ovrLayerHud_Info = 1,
ovrLayerHud_EnumSize = 0x7fffffff
} ovrLayerHudMode;
typedefenum ovrDebugHudStereoMode_ {
ovrDebugHudStereo_Off = 0,
ovrDebugHudStereo_Quad = 1,
ovrDebugHudStereo_QuadWithCrosshair = 2,
ovrDebugHudStereo_CrosshairAtInfinity = 3,
ovrDebugHudStereo_Count,
ovrDebugHudStereo_EnumSize = 0x7fffffff
} ovrDebugHudStereoMode;
#if !defined(OVR_EXPORTING_CAPI)
// -----------------------------------------------------------------------------------
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetExternalCameras(
ovrSession session,
ovrExternalCamera* cameras,
unsignedint* inoutCameraCount);
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_SetExternalCameraProperties(
ovrSession session,
constchar* name,
const ovrCameraIntrinsics* const intrinsics,
const ovrCameraExtrinsics* const extrinsics);
#endif // OVR_EXPORTING_CAPI
#if !defined(OVR_EXPORTING_CAPI)
// -----------------------------------------------------------------------------------
OVR_PUBLIC_FUNCTION(ovrBool)
ovr_GetBool(ovrSession session, constchar* propertyName, ovrBool defaultVal);
OVR_PUBLIC_FUNCTION(ovrBool)
ovr_SetBool(ovrSession session, constchar* propertyName, ovrBool value);
OVR_PUBLIC_FUNCTION(int) ovr_GetInt(ovrSession session, constchar* propertyName, int defaultVal);
OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetInt(ovrSession session, constchar* propertyName, int value);
OVR_PUBLIC_FUNCTION(float)
ovr_GetFloat(ovrSession session, constchar* propertyName, float defaultVal);
OVR_PUBLIC_FUNCTION(ovrBool)
ovr_SetFloat(ovrSession session, constchar* propertyName, float value);
OVR_PUBLIC_FUNCTION(unsignedint)
ovr_GetFloatArray(
ovrSession session,
constchar* propertyName,
float values[],
unsignedint valuesCapacity);
OVR_PUBLIC_FUNCTION(ovrBool)
ovr_SetFloatArray(
ovrSession session,
constchar* propertyName,
constfloat values[],
unsignedint valuesSize);
OVR_PUBLIC_FUNCTION(constchar*)
ovr_GetString(ovrSession session, constchar* propertyName, constchar* defaultVal);
OVR_PUBLIC_FUNCTION(ovrBool)
ovr_SetString(ovrSession session, constchar* propertyName, constchar* value);
#endif // !defined(OVR_EXPORTING_CAPI)
#ifdef __cplusplus
} // extern "C"
#endif
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
// -----------------------------------------------------------------------------------
// ***** Backward compatibility #includes
//
// This is at the bottom of this file because the following is dependent on the
// declarations above.
#if !defined(OVR_CAPI_NO_UTILS)
#include "Extras/OVR_CAPI_Util.h"
#endif
#endif // OVR_CAPI_h