summaryrefslogtreecommitdiffhomepage
path: root/ovr_sdk_win_23.0.0/LibOVR/Include/OVR_ErrorCode.h
blob: 80a67d0455419a146631be7aba70af4b96000c52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
/********************************************************************************/ /**
 \file  OVR_ErrorCode.h
 \brief     This header provides LibOVR error code declarations.
 \copyright Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
 *************************************************************************************/

#ifndef OVR_ErrorCode_h
#define OVR_ErrorCode_h

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



#ifndef OVR_RESULT_DEFINED
#define OVR_RESULT_DEFINED ///< Allows ovrResult to be independently defined.
/// API call results are represented at the highest level by a single ovrResult.
typedef int32_t ovrResult;
#endif

/// \brief Indicates if an ovrResult indicates success.
///
/// Some functions return additional successful values other than ovrSucces and
/// require usage of this macro to indicate successs.
///
#if !defined(OVR_SUCCESS)
#define OVR_SUCCESS(result) (result >= 0)
#endif

/// \brief Indicates if an ovrResult indicates an unqualified success.
///
/// This is useful for indicating that the code intentionally wants to
/// check for result == ovrSuccess as opposed to OVR_SUCCESS(), which
/// checks for result >= ovrSuccess.
///
#if !defined(OVR_UNQUALIFIED_SUCCESS)
#define OVR_UNQUALIFIED_SUCCESS(result) (result == ovrSuccess)
#endif

/// \brief Indicates if an ovrResult indicates failure.
///
#if !defined(OVR_FAILURE)
#define OVR_FAILURE(result) (!OVR_SUCCESS(result))
#endif

// Success is a value greater or equal to 0, while all error types are negative values.
#ifndef OVR_SUCCESS_DEFINED
#define OVR_SUCCESS_DEFINED ///< Allows ovrResult to be independently defined.
typedef enum ovrSuccessType_ {
  /// This is a general success result. Use OVR_SUCCESS to test for success.
  ovrSuccess = 0,
} ovrSuccessType;
#endif

// Public success types
// Success is a value greater or equal to 0, while all error types are negative values.
typedef enum ovrSuccessTypes_ {
  /// Returned from a call to SubmitFrame. The call succeeded, but what the app
  /// rendered will not be visible on the HMD. Ideally the app should continue
  /// calling SubmitFrame, but not do any rendering. When the result becomes
  /// ovrSuccess, rendering should continue as usual.
  ovrSuccess_NotVisible = 1000,

  /// Boundary is invalid due to sensor change or was not setup.
  ovrSuccess_BoundaryInvalid = 1001,

  /// Device is not available for the requested operation.
  ovrSuccess_DeviceUnavailable = 1002,
} ovrSuccessTypes;

// Public error types
typedef enum ovrErrorType_ {
  /******************/
  /* General errors */
  /******************/

  /// Failure to allocate memory.
  ovrError_MemoryAllocationFailure = -1000,

  /// Invalid ovrSession parameter provided.
  ovrError_InvalidSession = -1002,

  /// The operation timed out.
  ovrError_Timeout = -1003,

  /// The system or component has not been initialized.
  ovrError_NotInitialized = -1004,

  /// Invalid parameter provided. See error info or log for details.
  ovrError_InvalidParameter = -1005,

  /// Generic service error. See error info or log for details.
  ovrError_ServiceError = -1006,

  /// The given HMD doesn't exist.
  ovrError_NoHmd = -1007,

  /// Function call is not supported on this hardware/software
  ovrError_Unsupported = -1009,

  /// Specified device type isn't available.
  ovrError_DeviceUnavailable = -1010,

  /// The headset was in an invalid orientation for the requested
  /// operation (e.g. vertically oriented during ovr_RecenterPose).
  ovrError_InvalidHeadsetOrientation = -1011,

  /// The client failed to call ovr_Destroy on an active session before calling ovr_Shutdown.
  /// Or the client crashed.
  ovrError_ClientSkippedDestroy = -1012,

  /// The client failed to call ovr_Shutdown or the client crashed.
  ovrError_ClientSkippedShutdown = -1013,

  ///< The service watchdog discovered a deadlock.
  ovrError_ServiceDeadlockDetected = -1014,

  ///< Function call is invalid for object's current state
  ovrError_InvalidOperation = -1015,

  ///< Increase size of output array
  ovrError_InsufficientArraySize = -1016,

  /// There is not any external camera information stored by ovrServer.
  ovrError_NoExternalCameraInfo = -1017,

  /// Tracking is lost when ovr_GetDevicePoses() is called.
  ovrError_LostTracking = -1018,

  /// There was a problem initializing the external camera for capture
  ovrError_ExternalCameraInitializedFailed = -1019,

  /// There was a problem capturing external camera frames
  ovrError_ExternalCameraCaptureFailed = -1020,

  /// The external camera friendly name list and the external camera name list
  /// are not the fixed size(OVR_MAX_EXTERNAL_CAMERA_NAME_BUFFER_SIZE).
  ovrError_ExternalCameraNameListsBufferSize = -1021,

  /// The external camera friendly name list is not the same size as
  /// the external camera name list.
  ovrError_ExternalCameraNameListsMistmatch = -1022,

  /// The external camera property has not been sent to OVRServer
  /// when the user tries to open the camera.
  ovrError_ExternalCameraNotCalibrated = -1023,

  /// The external camera name is larger than OVR_EXTERNAL_CAMERA_NAME_SIZE-1
  ovrError_ExternalCameraNameWrongSize = -1024,

  /// The caller doesn't have permissions for the requested action.
  ovrError_AccessDenied = -1025,

  /*************************************************/
  /* Audio error range, reserved for Audio errors. */
  /*************************************************/

  /// Failure to find neither audio input or output device.
  ovrError_AudioDeviceNotFound = -2001,

  /// Generic COM error.
  ovrError_AudioComError = -2002,

  /// Failure to find the specified audio input device.
  ovrError_AudioInputDeviceNotFound = -2003,

  /// Failure to find the specified audio output device.
  ovrError_AudioOutputDeviceNotFound = -2004,

  /**************************/
  /* Initialization errors. */
  /**************************/

  /// Generic initialization error.
  ovrError_Initialize = -3000,

  /// Couldn't load LibOVRRT.
  ovrError_LibLoad = -3001,

  /// LibOVRRT version incompatibility.
  ovrError_LibVersion = -3002,

  /// Couldn't connect to the OVR Service.
  ovrError_ServiceConnection = -3003,

  /// OVR Service version incompatibility.
  ovrError_ServiceVersion = -3004,

  /// The operating system version is incompatible.
  ovrError_IncompatibleOS = -3005,

  /// Unable to initialize the HMD display.
  ovrError_DisplayInit = -3006,

  /// Unable to start the server. Is it already running?
  ovrError_ServerStart = -3007,

  /// Attempting to re-initialize with a different version.
  ovrError_Reinitialization = -3008,

  /// Chosen rendering adapters between client and service do not match
  ovrError_MismatchedAdapters = -3009,

  /// Calling application has leaked resources
  ovrError_LeakingResources = -3010,

  /// Client version too old to connect to service
  ovrError_ClientVersion = -3011,

  /// The operating system is out of date.
  ovrError_OutOfDateOS = -3012,

  /// The graphics driver is out of date.
  ovrError_OutOfDateGfxDriver = -3013,

  /// The graphics hardware is not supported
  ovrError_IncompatibleGPU = -3014,

  /// No valid VR display system found.
  ovrError_NoValidVRDisplaySystem = -3015,

  /// Feature or API is obsolete and no longer supported.
  ovrError_Obsolete = -3016,

  /// No supported VR display system found, but disabled or driverless adapter found.
  ovrError_DisabledOrDefaultAdapter = -3017,

  /// The system is using hybrid graphics (Optimus, etc...), which is not support.
  ovrError_HybridGraphicsNotSupported = -3018,

  /// Initialization of the DisplayManager failed.
  ovrError_DisplayManagerInit = -3019,

  /// Failed to get the interface for an attached tracker
  ovrError_TrackerDriverInit = -3020,

  /// LibOVRRT signature check failure.
  ovrError_LibSignCheck = -3021,

  /// LibOVRRT path failure.
  ovrError_LibPath = -3022,

  /// LibOVRRT symbol resolution failure.
  ovrError_LibSymbols = -3023,

  /// Failed to connect to the service because remote connections to the service are not allowed.
  ovrError_RemoteSession = -3024,

  /// Vulkan initialization error.
  ovrError_InitializeVulkan = -3025,

  /// The graphics driver is black-listed.
  ovrError_BlacklistedGfxDriver = -3026,

  /********************/
  /* Rendering errors */
  /********************/

  /// In the event of a system-wide graphics reset or cable unplug this is returned to the app.
  ovrError_DisplayLost = -6000,

  /// ovr_CommitTextureSwapChain was called too many times on a texture swapchain without
  /// calling submit to use the chain.
  ovrError_TextureSwapChainFull = -6001,

  /// The ovrTextureSwapChain is in an incomplete or inconsistent state.
  /// Ensure ovr_CommitTextureSwapChain was called at least once first.
  ovrError_TextureSwapChainInvalid = -6002,

  /// Graphics device has been reset (TDR, etc...)
  ovrError_GraphicsDeviceReset = -6003,

  /// HMD removed from the display adapter
  ovrError_DisplayRemoved = -6004,

  /// Content protection is not available for the display.
  ovrError_ContentProtectionNotAvailable = -6005,

  /// Application declared itself as an invisible type and is not allowed to submit frames.
  ovrError_ApplicationInvisible = -6006,

  /// The given request is disallowed under the current conditions.
  ovrError_Disallowed = -6007,

  /// Display portion of HMD is plugged into an incompatible port (ex: IGP)
  ovrError_DisplayPluggedIncorrectly = -6008,

  /// Returned in the event a virtual display system reaches a display limit
  ovrError_DisplayLimitReached = -6009,

  /****************/
  /* Fatal errors */
  /****************/

  ///< A runtime exception occurred. The application is required to shutdown LibOVR and
  /// re-initialize it before this error state will be cleared.
  ovrError_RuntimeException = -7000,

  /**********************/
  /* Calibration errors */
  /**********************/

  /// Result of a missing calibration block
  ovrError_NoCalibration = -9000,

  /// Result of an old calibration block
  ovrError_OldVersion = -9001,

  /// Result of a bad calibration block due to lengths
  ovrError_MisformattedBlock = -9002,

/****************/
/* Other errors */
/****************/


} ovrErrorType;

/// Provides information about the last error.
/// \see ovr_GetLastErrorInfo
typedef struct ovrErrorInfo_ {
  /// The result from the last API call that generated an error ovrResult.
  ovrResult Result;

  /// A UTF8-encoded null-terminated English string describing the problem.
  /// The format of this string is subject to change in future versions.
  char ErrorString[512];
} ovrErrorInfo;

#endif /* OVR_ErrorCode_h */