1 /********************************************************************************/ /**
\r
2 \file OVR_CAPI_Prototypes.h
\r
3 \brief Internal CAPI prototype listing macros
\r
4 \copyright Copyright 2016 Oculus VR, LLC. All Rights reserved.
\r
5 ************************************************************************************/
\r
7 #ifndef OVR_CAPI_Prototypes_h
\r
8 #define OVR_CAPI_Prototypes_h
\r
10 #include "OVR_CAPI.h"
\r
14 // OVR_LIST_*_APIS - apply passed in macros to a list of API entrypoints
\r
16 // The _ macro argument is applied for all current API versions
\r
17 // The X macro argument is applied for back-compat API versions
\r
19 // The tuple passed to either macro is (ReturnType, FunctionName, OptionalVersion, ParameterList)
\r
25 #define OVR_LIST_PUBLIC_APIS(_,X) \
\r
26 X(ovrBool, ovr_InitializeRenderingShimVersion, , (int requestedMinorVersion)) \
\r
27 _(ovrResult, ovr_Initialize, , (const ovrInitParams* params)) \
\r
28 _(void, ovr_Shutdown, , (void)) \
\r
29 _(const char*, ovr_GetVersionString, , (void)) \
\r
30 _(void, ovr_GetLastErrorInfo, , (ovrErrorInfo* errorInfo)) \
\r
31 _(ovrHmdDesc, ovr_GetHmdDesc, , (ovrSession session)) \
\r
32 _(unsigned int, ovr_GetTrackerCount, , (ovrSession session)) \
\r
33 _(ovrTrackerDesc, ovr_GetTrackerDesc, , (ovrSession session, unsigned int trackerDescIndex)) \
\r
34 _(ovrResult, ovr_Create, , (ovrSession* pSession, ovrGraphicsLuid* pLuid)) \
\r
35 _(void, ovr_Destroy, , (ovrSession session)) \
\r
36 _(ovrResult, ovr_GetSessionStatus, , (ovrSession session, ovrSessionStatus* sessionStatus)) \
\r
37 _(ovrResult, ovr_IsExtensionSupported, , (ovrSession session, ovrExtensions extension, ovrBool* outExtensionSupported)) \
\r
38 _(ovrResult, ovr_EnableExtension, , (ovrSession session, ovrExtensions extension)) \
\r
39 _(ovrResult, ovr_SetTrackingOriginType, , (ovrSession session, ovrTrackingOrigin origin)) \
\r
40 _(ovrTrackingOrigin, ovr_GetTrackingOriginType, , (ovrSession session)) \
\r
41 _(ovrResult, ovr_RecenterTrackingOrigin, , (ovrSession session)) \
\r
42 _(ovrResult, ovr_SpecifyTrackingOrigin, , (ovrSession session, ovrPosef originPose)) \
\r
43 _(void, ovr_ClearShouldRecenterFlag, , (ovrSession session)) \
\r
44 _(ovrTrackingState, ovr_GetTrackingState, , (ovrSession session, double absTime, ovrBool latencyMarker)) \
\r
45 _(ovrTrackerPose, ovr_GetTrackerPose, , (ovrSession session, unsigned int index)) \
\r
46 _(ovrResult, ovr_GetInputState, , (ovrSession session, ovrControllerType controllerType, ovrInputState*)) \
\r
47 _(unsigned int, ovr_GetConnectedControllerTypes, , (ovrSession session)) \
\r
48 _(ovrSizei, ovr_GetFovTextureSize, , (ovrSession session, ovrEyeType eye, ovrFovPort fov, float pixelsPerDisplayPixel)) \
\r
49 _(ovrResult, ovr_WaitToBeginFrame, , (ovrSession session, long long frameIndex)) \
\r
50 _(ovrResult, ovr_BeginFrame, , (ovrSession session, long long frameIndex)) \
\r
51 _(ovrResult, ovr_EndFrame, , (ovrSession session, long long frameIndex, const ovrViewScaleDesc* viewScaleDesc, ovrLayerHeader const * const * layerPtrList, unsigned int layerCount)) \
\r
52 X(ovrResult, ovr_SubmitFrame, , (ovrSession session, long long frameIndex, const ovrViewScaleDescPre117* viewScaleDesc, ovrLayerHeader const * const * layerPtrList, unsigned int layerCount)) \
\r
53 _(ovrResult, ovr_SubmitFrame, 2, (ovrSession session, long long frameIndex, const ovrViewScaleDesc* viewScaleDesc, ovrLayerHeader const * const * layerPtrList, unsigned int layerCount)) \
\r
54 X(ovrEyeRenderDescPre117, ovr_GetRenderDesc, , (ovrSession session, ovrEyeType eyeType, ovrFovPort fov)) \
\r
55 _(ovrEyeRenderDesc, ovr_GetRenderDesc, 2, (ovrSession session, ovrEyeType eyeType, ovrFovPort fov)) \
\r
56 _(double, ovr_GetPredictedDisplayTime, , (ovrSession session, long long frameIndex)) \
\r
57 _(double, ovr_GetTimeInSeconds, , (void)) \
\r
58 _(ovrBool, ovr_GetBool, , (ovrSession session, const char* propertyName, ovrBool defaultVal)) \
\r
59 _(ovrBool, ovr_SetBool, , (ovrSession session, const char* propertyName, ovrBool value)) \
\r
60 _(int, ovr_GetInt, , (ovrSession session, const char* propertyName, int defaultVal)) \
\r
61 _(ovrBool, ovr_SetInt, , (ovrSession session, const char* propertyName, int value)) \
\r
62 _(float, ovr_GetFloat, , (ovrSession session, const char* propertyName, float defaultVal)) \
\r
63 _(ovrBool, ovr_SetFloat, , (ovrSession session, const char* propertyName, float value)) \
\r
64 _(unsigned int, ovr_GetFloatArray, , (ovrSession session, const char* propertyName, float values[], unsigned int arraySize)) \
\r
65 _(ovrBool, ovr_SetFloatArray, , (ovrSession session, const char* propertyName, const float values[], unsigned int arraySize)) \
\r
66 _(const char*, ovr_GetString, , (ovrSession session, const char* propertyName, const char* defaultVal)) \
\r
67 _(ovrBool, ovr_SetString, , (ovrSession session, const char* propertyName, const char* value)) \
\r
68 _(int, ovr_TraceMessage, , (int level, const char* message)) \
\r
69 _(ovrResult, ovr_IdentifyClient, , (const char* identity)) \
\r
70 _(ovrResult, ovr_CreateTextureSwapChainGL, , (ovrSession session, const ovrTextureSwapChainDesc* desc, ovrTextureSwapChain* outTextureChain)) \
\r
71 _(ovrResult, ovr_CreateMirrorTextureGL, , (ovrSession session, const ovrMirrorTextureDesc* desc, ovrMirrorTexture* outMirrorTexture)) \
\r
72 _(ovrResult, ovr_CreateMirrorTextureWithOptionsGL, , (ovrSession session, const ovrMirrorTextureDesc* desc, ovrMirrorTexture* outMirrorTexture)) \
\r
73 _(ovrResult, ovr_GetTextureSwapChainBufferGL, , (ovrSession session, ovrTextureSwapChain chain, int index, unsigned int* texId)) \
\r
74 _(ovrResult, ovr_GetMirrorTextureBufferGL, , (ovrSession session, ovrMirrorTexture mirror, unsigned int* texId)) \
\r
75 _(ovrResult, ovr_GetTextureSwapChainLength, , (ovrSession session, ovrTextureSwapChain chain, int* length)) \
\r
76 _(ovrResult, ovr_GetTextureSwapChainCurrentIndex, , (ovrSession session, ovrTextureSwapChain chain, int* currentIndex)) \
\r
77 _(ovrResult, ovr_GetTextureSwapChainDesc, , (ovrSession session, ovrTextureSwapChain chain, ovrTextureSwapChainDesc* desc)) \
\r
78 _(ovrResult, ovr_CommitTextureSwapChain, , (ovrSession session, ovrTextureSwapChain chain)) \
\r
79 _(void, ovr_DestroyTextureSwapChain, , (ovrSession session, ovrTextureSwapChain chain)) \
\r
80 _(void, ovr_DestroyMirrorTexture, , (ovrSession session, ovrMirrorTexture texture)) \
\r
81 X(ovrResult, ovr_SetQueueAheadFraction, , (ovrSession session, float queueAheadFraction)) \
\r
82 _(ovrResult, ovr_Lookup, , (const char* name, void** data)) \
\r
83 _(ovrTouchHapticsDesc, ovr_GetTouchHapticsDesc, , (ovrSession session, ovrControllerType controllerType)) \
\r
84 _(ovrResult, ovr_SetControllerVibration, , (ovrSession session, ovrControllerType controllerType, float frequency, float amplitude)) \
\r
85 _(ovrResult, ovr_SubmitControllerVibration, , (ovrSession session, ovrControllerType controllerType, const ovrHapticsBuffer* buffer)) \
\r
86 _(ovrResult, ovr_GetControllerVibrationState, , (ovrSession session, ovrControllerType controllerType, ovrHapticsPlaybackState* outState)) \
\r
87 _(ovrResult, ovr_TestBoundary, , (ovrSession session, ovrTrackedDeviceType deviceBitmask, ovrBoundaryType singleBoundaryType, ovrBoundaryTestResult* outTestResult)) \
\r
88 _(ovrResult, ovr_TestBoundaryPoint, , (ovrSession session, const ovrVector3f* point, ovrBoundaryType singleBoundaryType, ovrBoundaryTestResult* outTestResult)) \
\r
89 _(ovrResult, ovr_SetBoundaryLookAndFeel, , (ovrSession session, const ovrBoundaryLookAndFeel* lookAndFeel)) \
\r
90 _(ovrResult, ovr_ResetBoundaryLookAndFeel, , (ovrSession session)) \
\r
91 _(ovrResult, ovr_GetBoundaryGeometry, , (ovrSession session, ovrBoundaryType singleBoundaryType, ovrVector3f* outFloorPoints, int* outFloorPointsCount)) \
\r
92 _(ovrResult, ovr_GetBoundaryDimensions, , (ovrSession session, ovrBoundaryType singleBoundaryType, ovrVector3f* outDimension)) \
\r
93 _(ovrResult, ovr_GetBoundaryVisible, , (ovrSession session, ovrBool* outIsVisible)) \
\r
94 _(ovrResult, ovr_RequestBoundaryVisible, , (ovrSession session, ovrBool visible)) \
\r
95 _(ovrResult, ovr_GetPerfStats, , (ovrSession session, ovrPerfStats* outPerfStats)) \
\r
96 _(ovrResult, ovr_ResetPerfStats, , (ovrSession session))\
\r
97 _(ovrResult, ovr_GetExternalCameras, , (ovrSession session, ovrExternalCamera* outCameras, unsigned int* outCameraCount))\
\r
98 _(ovrResult, ovr_SetExternalCameraProperties, , (ovrSession session, const char* name, const ovrCameraIntrinsics* const intrinsics, const ovrCameraExtrinsics* const extrinsics ))\
\r
100 #if defined (_WIN32)
\r
101 #define OVR_LIST_WIN32_APIS(_,X) \
\r
102 _(ovrResult, ovr_CreateTextureSwapChainDX, , (ovrSession session, IUnknown* d3dPtr, const ovrTextureSwapChainDesc* desc, ovrTextureSwapChain* outTextureChain)) \
\r
103 _(ovrResult, ovr_CreateMirrorTextureDX, , (ovrSession session, IUnknown* d3dPtr, const ovrMirrorTextureDesc* desc, ovrMirrorTexture* outMirrorTexture)) \
\r
104 _(ovrResult, ovr_CreateMirrorTextureWithOptionsDX, , (ovrSession session, IUnknown* d3dPtr, const ovrMirrorTextureDesc* desc, ovrMirrorTexture* outMirrorTexture)) \
\r
105 _(ovrResult, ovr_GetTextureSwapChainBufferDX, , (ovrSession session, ovrTextureSwapChain chain, int index, IID iid, void** ppObject)) \
\r
106 _(ovrResult, ovr_GetMirrorTextureBufferDX, , (ovrSession session, ovrMirrorTexture mirror, IID iid, void** ppObject)) \
\r
107 _(ovrResult, ovr_GetAudioDeviceOutWaveId, , (UINT* deviceOutId)) \
\r
108 _(ovrResult, ovr_GetAudioDeviceInWaveId, , (UINT* deviceInId)) \
\r
109 _(ovrResult, ovr_GetAudioDeviceOutGuidStr, , (WCHAR* deviceOutStrBuffer)) \
\r
110 _(ovrResult, ovr_GetAudioDeviceOutGuid, , (GUID* deviceOutGuid)) \
\r
111 _(ovrResult, ovr_GetAudioDeviceInGuidStr, , (WCHAR* deviceInStrBuffer)) \
\r
112 _(ovrResult, ovr_GetAudioDeviceInGuid, , (GUID* deviceInGuid)) \
\r
113 _(ovrResult, ovr_GetInstanceExtensionsVk, , (ovrGraphicsLuid luid, char* extensionNames, uint32_t* inoutExtensionNamesSize)) \
\r
114 _(ovrResult, ovr_GetDeviceExtensionsVk, , (ovrGraphicsLuid luid, char* extensionNames, uint32_t* inoutExtensionNamesSize)) \
\r
115 _(ovrResult, ovr_GetSessionPhysicalDeviceVk, , (ovrSession session, ovrGraphicsLuid luid, VkInstance instance, VkPhysicalDevice* out_physicalDevice)) \
\r
116 X(ovrResult, ovr_SetSynchonizationQueueVk, , (ovrSession session, VkQueue queue)) \
\r
117 _(ovrResult, ovr_SetSynchronizationQueueVk, , (ovrSession session, VkQueue queue)) \
\r
118 _(ovrResult, ovr_CreateTextureSwapChainVk, , (ovrSession session, VkDevice device, const ovrTextureSwapChainDesc* desc, ovrTextureSwapChain* out_TextureSwapChain)) \
\r
119 _(ovrResult, ovr_GetTextureSwapChainBufferVk, , (ovrSession session, ovrTextureSwapChain chain, int index, VkImage* out_Image)) \
\r
120 _(ovrResult, ovr_CreateMirrorTextureWithOptionsVk, , (ovrSession session, VkDevice device, const ovrMirrorTextureDesc* desc, ovrMirrorTexture* out_MirrorTexture)) \
\r
121 _(ovrResult, ovr_GetMirrorTextureBufferVk, , (ovrSession session, ovrMirrorTexture mirrorTexture, VkImage* out_Image))
\r
123 #define OVR_LIST_WIN32_APIS(_,X)
\r
126 #define OVR_LIST_INTERNAL_APIS(_,X)
\r
128 // We need to forward declare the ovrSensorData type here, as it won't be in a public OVR_CAPI.h header.
\r
129 struct ovrSensorData_;
\r
130 typedef struct ovrSensorData_ ovrSensorData;
\r
132 #define OVR_LIST_PRIVATE_APIS(_,X) \
\r
133 _(ovrTrackingState, ovr_GetTrackingStateWithSensorData, , (ovrSession session, double absTime, ovrBool latencyMarker, ovrSensorData* sensorData)) \
\r
134 _(ovrResult, ovr_GetDevicePoses, , (ovrSession session, ovrTrackedDeviceType* deviceTypes, int deviceCount, double absTime, ovrPoseStatef* outDevicePoses))
\r
139 // OVR_LIST_APIS - master list of all API entrypoints
\r
142 #define OVR_LIST_APIS(_, X) \
\r
143 OVR_LIST_PUBLIC_APIS(_, X) \
\r
144 OVR_LIST_WIN32_APIS(_, X) \
\r
145 OVR_LIST_INTERNAL_APIS(_, X) \
\r
146 OVR_LIST_PRIVATE_APIS(_, X)
\r
148 #endif // OVR_CAPI_Prototypes_h
\r