1 /********************************************************************************/ /**
\r
2 \file OVR_ErrorCode.h
\r
3 \brief This header provides LibOVR error code declarations.
\r
4 \copyright Copyright 2015-2016 Oculus VR, LLC All Rights reserved.
\r
5 *************************************************************************************/
\r
7 #ifndef OVR_ErrorCode_h
\r
8 #define OVR_ErrorCode_h
\r
10 #include "OVR_Version.h"
\r
15 #ifndef OVR_RESULT_DEFINED
\r
16 #define OVR_RESULT_DEFINED ///< Allows ovrResult to be independently defined.
\r
17 /// API call results are represented at the highest level by a single ovrResult.
\r
18 typedef int32_t ovrResult;
\r
21 /// \brief Indicates if an ovrResult indicates success.
\r
23 /// Some functions return additional successful values other than ovrSucces and
\r
24 /// require usage of this macro to indicate successs.
\r
26 #if !defined(OVR_SUCCESS)
\r
27 #define OVR_SUCCESS(result) (result >= 0)
\r
30 /// \brief Indicates if an ovrResult indicates an unqualified success.
\r
32 /// This is useful for indicating that the code intentionally wants to
\r
33 /// check for result == ovrSuccess as opposed to OVR_SUCCESS(), which
\r
34 /// checks for result >= ovrSuccess.
\r
36 #if !defined(OVR_UNQUALIFIED_SUCCESS)
\r
37 #define OVR_UNQUALIFIED_SUCCESS(result) (result == ovrSuccess)
\r
40 /// \brief Indicates if an ovrResult indicates failure.
\r
42 #if !defined(OVR_FAILURE)
\r
43 #define OVR_FAILURE(result) (!OVR_SUCCESS(result))
\r
46 // Success is a value greater or equal to 0, while all error types are negative values.
\r
47 #ifndef OVR_SUCCESS_DEFINED
\r
48 #define OVR_SUCCESS_DEFINED ///< Allows ovrResult to be independently defined.
\r
49 typedef enum ovrSuccessType_ {
\r
50 /// This is a general success result. Use OVR_SUCCESS to test for success.
\r
55 // Public success types
\r
56 // Success is a value greater or equal to 0, while all error types are negative values.
\r
57 typedef enum ovrSuccessTypes_ {
\r
58 /// Returned from a call to SubmitFrame. The call succeeded, but what the app
\r
59 /// rendered will not be visible on the HMD. Ideally the app should continue
\r
60 /// calling SubmitFrame, but not do any rendering. When the result becomes
\r
61 /// ovrSuccess, rendering should continue as usual.
\r
62 ovrSuccess_NotVisible = 1000,
\r
64 /// Boundary is invalid due to sensor change or was not setup.
\r
65 ovrSuccess_BoundaryInvalid = 1001,
\r
67 /// Device is not available for the requested operation.
\r
68 ovrSuccess_DeviceUnavailable = 1002,
\r
71 // Public error types
\r
72 typedef enum ovrErrorType_ {
\r
73 /******************/
\r
74 /* General errors */
\r
75 /******************/
\r
77 /// Failure to allocate memory.
\r
78 ovrError_MemoryAllocationFailure = -1000,
\r
80 /// Invalid ovrSession parameter provided.
\r
81 ovrError_InvalidSession = -1002,
\r
83 /// The operation timed out.
\r
84 ovrError_Timeout = -1003,
\r
86 /// The system or component has not been initialized.
\r
87 ovrError_NotInitialized = -1004,
\r
89 /// Invalid parameter provided. See error info or log for details.
\r
90 ovrError_InvalidParameter = -1005,
\r
92 /// Generic service error. See error info or log for details.
\r
93 ovrError_ServiceError = -1006,
\r
95 /// The given HMD doesn't exist.
\r
96 ovrError_NoHmd = -1007,
\r
98 /// Function call is not supported on this hardware/software
\r
99 ovrError_Unsupported = -1009,
\r
101 /// Specified device type isn't available.
\r
102 ovrError_DeviceUnavailable = -1010,
\r
104 /// The headset was in an invalid orientation for the requested
\r
105 /// operation (e.g. vertically oriented during ovr_RecenterPose).
\r
106 ovrError_InvalidHeadsetOrientation = -1011,
\r
108 /// The client failed to call ovr_Destroy on an active session before calling ovr_Shutdown.
\r
109 /// Or the client crashed.
\r
110 ovrError_ClientSkippedDestroy = -1012,
\r
112 /// The client failed to call ovr_Shutdown or the client crashed.
\r
113 ovrError_ClientSkippedShutdown = -1013,
\r
115 ///< The service watchdog discovered a deadlock.
\r
116 ovrError_ServiceDeadlockDetected = -1014,
\r
118 ///< Function call is invalid for object's current state
\r
119 ovrError_InvalidOperation = -1015,
\r
121 ///< Increase size of output array
\r
122 ovrError_InsufficientArraySize = -1016,
\r
124 /// There is not any external camera information stored by ovrServer.
\r
125 ovrError_NoExternalCameraInfo = -1017,
\r
127 /// Tracking is lost when ovr_GetDevicePoses() is called.
\r
128 ovrError_LostTracking = -1018,
\r
130 /// There was a problem initializing the external camera for capture
\r
131 ovrError_ExternalCameraInitializedFailed = -1019,
\r
133 /// There was a problem capturing external camera frames
\r
134 ovrError_ExternalCameraCaptureFailed = -1020,
\r
136 /// The external camera friendly name list and the external camera name list
\r
137 /// are not the fixed size(OVR_MAX_EXTERNAL_CAMERA_NAME_BUFFER_SIZE).
\r
138 ovrError_ExternalCameraNameListsBufferSize = -1021,
\r
140 /// The external camera friendly name list is not the same size as
\r
141 /// the external camera name list.
\r
142 ovrError_ExternalCameraNameListsMistmatch = -1022,
\r
144 /// The external camera property has not been sent to OVRServer
\r
145 /// when the user tries to open the camera.
\r
146 ovrError_ExternalCameraNotCalibrated = -1023,
\r
148 /// The external camera name is larger than OVR_EXTERNAL_CAMERA_NAME_SIZE-1
\r
149 ovrError_ExternalCameraNameWrongSize = -1024,
\r
151 /*************************************************/
\r
152 /* Audio error range, reserved for Audio errors. */
\r
153 /*************************************************/
\r
155 /// Failure to find the specified audio device.
\r
156 ovrError_AudioDeviceNotFound = -2001,
\r
158 /// Generic COM error.
\r
159 ovrError_AudioComError = -2002,
\r
161 /**************************/
\r
162 /* Initialization errors. */
\r
163 /**************************/
\r
165 /// Generic initialization error.
\r
166 ovrError_Initialize = -3000,
\r
168 /// Couldn't load LibOVRRT.
\r
169 ovrError_LibLoad = -3001,
\r
171 /// LibOVRRT version incompatibility.
\r
172 ovrError_LibVersion = -3002,
\r
174 /// Couldn't connect to the OVR Service.
\r
175 ovrError_ServiceConnection = -3003,
\r
177 /// OVR Service version incompatibility.
\r
178 ovrError_ServiceVersion = -3004,
\r
180 /// The operating system version is incompatible.
\r
181 ovrError_IncompatibleOS = -3005,
\r
183 /// Unable to initialize the HMD display.
\r
184 ovrError_DisplayInit = -3006,
\r
186 /// Unable to start the server. Is it already running?
\r
187 ovrError_ServerStart = -3007,
\r
189 /// Attempting to re-initialize with a different version.
\r
190 ovrError_Reinitialization = -3008,
\r
192 /// Chosen rendering adapters between client and service do not match
\r
193 ovrError_MismatchedAdapters = -3009,
\r
195 /// Calling application has leaked resources
\r
196 ovrError_LeakingResources = -3010,
\r
198 /// Client version too old to connect to service
\r
199 ovrError_ClientVersion = -3011,
\r
201 /// The operating system is out of date.
\r
202 ovrError_OutOfDateOS = -3012,
\r
204 /// The graphics driver is out of date.
\r
205 ovrError_OutOfDateGfxDriver = -3013,
\r
207 /// The graphics hardware is not supported
\r
208 ovrError_IncompatibleGPU = -3014,
\r
210 /// No valid VR display system found.
\r
211 ovrError_NoValidVRDisplaySystem = -3015,
\r
213 /// Feature or API is obsolete and no longer supported.
\r
214 ovrError_Obsolete = -3016,
\r
216 /// No supported VR display system found, but disabled or driverless adapter found.
\r
217 ovrError_DisabledOrDefaultAdapter = -3017,
\r
219 /// The system is using hybrid graphics (Optimus, etc...), which is not support.
\r
220 ovrError_HybridGraphicsNotSupported = -3018,
\r
222 /// Initialization of the DisplayManager failed.
\r
223 ovrError_DisplayManagerInit = -3019,
\r
225 /// Failed to get the interface for an attached tracker
\r
226 ovrError_TrackerDriverInit = -3020,
\r
228 /// LibOVRRT signature check failure.
\r
229 ovrError_LibSignCheck = -3021,
\r
231 /// LibOVRRT path failure.
\r
232 ovrError_LibPath = -3022,
\r
234 /// LibOVRRT symbol resolution failure.
\r
235 ovrError_LibSymbols = -3023,
\r
237 /// Failed to connect to the service because remote connections to the service are not allowed.
\r
238 ovrError_RemoteSession = -3024,
\r
240 /// Vulkan initialization error.
\r
241 ovrError_InitializeVulkan = -3025,
\r
243 /// The graphics driver is black-listed.
\r
244 ovrError_BlacklistedGfxDriver = -3026,
\r
246 /********************/
\r
247 /* Rendering errors */
\r
248 /********************/
\r
250 /// In the event of a system-wide graphics reset or cable unplug this is returned to the app.
\r
251 ovrError_DisplayLost = -6000,
\r
253 /// ovr_CommitTextureSwapChain was called too many times on a texture swapchain without
\r
254 /// calling submit to use the chain.
\r
255 ovrError_TextureSwapChainFull = -6001,
\r
257 /// The ovrTextureSwapChain is in an incomplete or inconsistent state.
\r
258 /// Ensure ovr_CommitTextureSwapChain was called at least once first.
\r
259 ovrError_TextureSwapChainInvalid = -6002,
\r
261 /// Graphics device has been reset (TDR, etc...)
\r
262 ovrError_GraphicsDeviceReset = -6003,
\r
264 /// HMD removed from the display adapter
\r
265 ovrError_DisplayRemoved = -6004,
\r
267 /// Content protection is not available for the display.
\r
268 ovrError_ContentProtectionNotAvailable = -6005,
\r
270 /// Application declared itself as an invisible type and is not allowed to submit frames.
\r
271 ovrError_ApplicationInvisible = -6006,
\r
273 /// The given request is disallowed under the current conditions.
\r
274 ovrError_Disallowed = -6007,
\r
276 /// Display portion of HMD is plugged into an incompatible port (ex: IGP)
\r
277 ovrError_DisplayPluggedIncorrectly = -6008,
\r
279 /// Returned in the event a virtual display system reaches a display limit
\r
280 ovrError_DisplayLimitReached = -6009,
\r
286 ///< A runtime exception occurred. The application is required to shutdown LibOVR and
\r
287 /// re-initialize it before this error state will be cleared.
\r
288 ovrError_RuntimeException = -7000,
\r
290 /**********************/
\r
291 /* Calibration errors */
\r
292 /**********************/
\r
294 /// Result of a missing calibration block
\r
295 ovrError_NoCalibration = -9000,
\r
297 /// Result of an old calibration block
\r
298 ovrError_OldVersion = -9001,
\r
300 /// Result of a bad calibration block due to lengths
\r
301 ovrError_MisformattedBlock = -9002,
\r
310 /// Provides information about the last error.
\r
311 /// \see ovr_GetLastErrorInfo
\r
312 typedef struct ovrErrorInfo_ {
\r
313 /// The result from the last API call that generated an error ovrResult.
\r
316 /// A UTF8-encoded null-terminated English string describing the problem.
\r
317 /// The format of this string is subject to change in future versions.
\r
318 char ErrorString[512];
\r
321 #endif /* OVR_ErrorCode_h */
\r