diff options
| author | raysan5 <raysan5@gmail.com> | 2016-05-31 20:08:36 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-05-31 20:08:36 +0200 |
| commit | 8f91ed81c58fd5cdbeda4db5478649bd677712da (patch) | |
| tree | e5dfd2e4784aff7630df89f392fd1498f1bfad7d /examples/oculus_glfw_sample/OculusSDK | |
| parent | d17a0cee1aa53978387e68be58d901bffd1ac0a9 (diff) | |
| download | raylib-8f91ed81c58fd5cdbeda4db5478649bd677712da.tar.gz raylib-8f91ed81c58fd5cdbeda4db5478649bd677712da.zip | |
Updated Oculus sample to Oculus SDK 1.4
Still working on the sample but almost finished. Some rlgl internals
redesign required and it will be ready!
Diffstat (limited to 'examples/oculus_glfw_sample/OculusSDK')
6 files changed, 78 insertions, 23 deletions
diff --git a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/Extras/OVR_CAPI_Util.h b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/Extras/OVR_CAPI_Util.h index 587c696e..552f3b12 100644 --- a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/Extras/OVR_CAPI_Util.h +++ b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/Extras/OVR_CAPI_Util.h @@ -137,14 +137,14 @@ OVR_PUBLIC_FUNCTION(ovrMatrix4f) ovrMatrix4f_OrthoSubProjection(ovrMatrix4f proj /// Computes offset eye poses based on headPose returned by ovrTrackingState. /// /// \param[in] headPose Indicates the HMD position and orientation to use for the calculation. -/// \param[in] HmdToEyeOffset Can be ovrEyeRenderDesc.HmdToEyeOffset returned from +/// \param[in] hmdToEyeOffset Can be ovrEyeRenderDesc.HmdToEyeOffset returned from /// ovr_GetRenderDesc. For monoscopic rendering, use a vector that is the average /// of the two vectors for both eyes. /// \param[out] outEyePoses If outEyePoses are used for rendering, they should be passed to /// ovr_SubmitFrame in ovrLayerEyeFov::RenderPose or ovrLayerEyeFovDepth::RenderPose. /// OVR_PUBLIC_FUNCTION(void) ovr_CalcEyePoses(ovrPosef headPose, - const ovrVector3f HmdToEyeOffset[2], + const ovrVector3f hmdToEyeOffset[2], ovrPosef outEyePoses[2]); @@ -158,17 +158,17 @@ OVR_PUBLIC_FUNCTION(void) ovr_CalcEyePoses(ovrPosef headPose, /// \param[in] hmd Specifies an ovrSession previously returned by ovr_Create. /// \param[in] frameIndex Specifies the targeted frame index, or 0 to refer to one frame after /// the last time ovr_SubmitFrame was called. -/// \param[in] HmdToEyeOffset Can be ovrEyeRenderDesc.HmdToEyeOffset returned from -/// ovr_GetRenderDesc. For monoscopic rendering, use a vector that is the average -/// of the two vectors for both eyes. /// \param[in] latencyMarker Specifies that this call is the point in time where /// the "App-to-Mid-Photon" latency timer starts from. If a given ovrLayer /// provides "SensorSampleTimestamp", that will override the value stored here. +/// \param[in] hmdToEyeOffset Can be ovrEyeRenderDesc.HmdToEyeOffset returned from +/// ovr_GetRenderDesc. For monoscopic rendering, use a vector that is the average +/// of the two vectors for both eyes. /// \param[out] outEyePoses The predicted eye poses. /// \param[out] outSensorSampleTime The time when this function was called. May be NULL, in which case it is ignored. /// OVR_PUBLIC_FUNCTION(void) ovr_GetEyePoses(ovrSession session, long long frameIndex, ovrBool latencyMarker, - const ovrVector3f HmdToEyeOffset[2], + const ovrVector3f hmdToEyeOffset[2], ovrPosef outEyePoses[2], double* outSensorSampleTime); diff --git a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/Extras/OVR_Math.h b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/Extras/OVR_Math.h index 3a8a8045..c182ed5b 100644 --- a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/Extras/OVR_Math.h +++ b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/Extras/OVR_Math.h @@ -1,7 +1,7 @@ /********************************************************************************//** \file OVR_Math.h \brief Implementation of 3D primitives such as vectors, matrices. -\copyright Copyright 2015 Oculus VR, LLC All Rights reserved. +\copyright Copyright 2014-2016 Oculus VR, LLC All Rights reserved. *************************************************************************************/ #ifndef OVR_Math_h @@ -1754,7 +1754,7 @@ public: : Rotation(s.Rotation), Translation(s.Translation) { // Ensure normalized rotation if converting from float to double - if (sizeof(T) > sizeof(Math<T>::OtherFloatType)) + if (sizeof(T) > sizeof(typename Math<T>::OtherFloatType)) Rotation.Normalize(); } diff --git a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI.h b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI.h index 5eb17e60..b1ec3cc0 100644 --- a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI.h +++ b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI.h @@ -1,7 +1,7 @@ /********************************************************************************//** \file OVR_CAPI.h \brief C Interface to the Oculus PC SDK tracking and rendering library. -\copyright Copyright 2014-2016 Oculus VR, LLC All Rights reserved. +\copyright Copyright 2014 Oculus VR, LLC All Rights reserved. ************************************************************************************/ #ifndef OVR_CAPI_h // We don't use version numbers within this name, as all versioned variations of this file are currently mutually exclusive. @@ -687,6 +687,11 @@ typedef enum ovrTextureMiscFlags_ /// call. This flag requires that RenderTarget binding also be specified. ovrTextureMisc_AllowGenerateMips = 0x0002, + /// Texture swap chain contains protected content, and requires + /// HDCP connection in order to display to HMD. Also prevents + /// mirroring or other redirection of any frame containing this contents + ovrTextureMisc_ProtectedContent = 0x0004, + ovrTextureMisc_EnumSize = 0x7fffffff ///< \internal Force type int32_t. } ovrTextureFlags; @@ -695,7 +700,7 @@ typedef enum ovrTextureMiscFlags_ /// \see ovr_CreateTextureSwapChainDX /// \see ovr_CreateTextureSwapChainGL /// -typedef struct +typedef struct ovrTextureSwapChainDesc_ { ovrTextureType Type; ovrTextureFormat Format; @@ -705,7 +710,7 @@ typedef struct int MipLevels; int SampleCount; ///< Current only supported on depth textures ovrBool StaticImage; ///< Not buffered in a chain. For images that don't change - unsigned int MiscFlags; ///< ovrTextureMiscFlags + unsigned int MiscFlags; ///< ovrTextureFlags unsigned int BindFlags; ///< ovrTextureBindFlags. Not used for GL. } ovrTextureSwapChainDesc; @@ -714,12 +719,12 @@ typedef struct /// \see ovr_CreateMirrorTextureDX /// \see ovr_CreateMirrorTextureGL /// -typedef struct +typedef struct ovrMirrorTextureDesc_ { ovrTextureFormat Format; int Width; int Height; - unsigned int MiscFlags; ///< ovrTextureMiscFlags + unsigned int MiscFlags; ///< ovrTextureFlags } ovrMirrorTextureDesc; typedef struct ovrTextureSwapChainData* ovrTextureSwapChain; @@ -987,8 +992,8 @@ extern "C" { /// Initializes LibOVR /// /// Initialize LibOVR for application usage. This includes finding and loading the LibOVRRT -/// shared library. No LibOVR API functions, other than ovr_GetLastErrorInfo, can be called -/// unless ovr_Initialize succeeds. A successful call to ovr_Initialize must be eventually +/// shared library. No LibOVR API functions, other than ovr_GetLastErrorInfo and ovr_Detect, can +/// be called unless ovr_Initialize succeeds. A successful call to ovr_Initialize must be eventually /// followed by a call to ovr_Shutdown. ovr_Initialize calls are idempotent. /// Calling ovr_Initialize twice does not require two matching calls to ovr_Shutdown. /// If already initialized, the return value is ovr_Success. @@ -1696,6 +1701,14 @@ OVR_PUBLIC_FUNCTION(void) ovr_DestroyMirrorTexture(ovrSession session, ovrMirror /// \param[in] pixelsPerDisplayPixel Specifies the ratio of the number of render target pixels /// to display pixels at the center of distortion. 1.0 is the default value. Lower /// values can improve performance, higher values give improved quality. +/// +/// <b>Example code</b> +/// \code{.cpp} +/// ovrHmdDesc hmdDesc = ovr_GetHmdDesc(session); +/// ovrSizei eyeSizeLeft = ovr_GetFovTextureSize(session, ovrEye_Left, hmdDesc.DefaultEyeFov[ovrEye_Left], 1.0f); +/// ovrSizei eyeSizeRight = ovr_GetFovTextureSize(session, ovrEye_Right, hmdDesc.DefaultEyeFov[ovrEye_Right], 1.0f); +/// \endcode +/// /// \return Returns the texture width and height size. /// OVR_PUBLIC_FUNCTION(ovrSizei) ovr_GetFovTextureSize(ovrSession session, ovrEyeType eye, ovrFovPort fov, diff --git a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h index 5c6e94eb..50806bca 100644 --- a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h +++ b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h @@ -67,8 +67,8 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateTextureSwapChainDX(ovrSession session, /// /// <b>Example code</b> /// \code{.cpp} -/// ovr_GetTextureSwapChainBuffer(session, chain, 0, IID_ID3D11Texture2D, &d3d11Texture); -/// ovr_GetTextureSwapChainBuffer(session, chain, 1, IID_PPV_ARGS(&dxgiResource)); +/// ovr_GetTextureSwapChainBufferDX(session, chain, 0, IID_ID3D11Texture2D, &d3d11Texture); +/// ovr_GetTextureSwapChainBufferDX(session, chain, 1, IID_PPV_ARGS(&dxgiResource)); /// \endcode /// OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainBufferDX(ovrSession session, @@ -102,6 +102,21 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainBufferDX(ovrSession sessio /// compositor continues to treat is as sRGB. Failure to do so will cause the compositor to apply unexpected gamma conversions leading to /// gamma-curve artifacts. /// +/// +/// <b>Example code</b> +/// \code{.cpp} +/// ovrMirrorTexture mirrorTexture = nullptr; +/// ovrMirrorTextureDesc mirrorDesc = {}; +/// mirrorDesc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; +/// mirrorDesc.Width = mirrorWindowWidth; +/// mirrorDesc.Height = mirrorWindowHeight; +/// ovrResult result = ovr_CreateMirrorTextureDX(session, d3d11Device, &mirrorDesc, &mirrorTexture); +/// [...] +/// // Destroy the texture when done with it. +/// ovr_DestroyMirrorTexture(session, mirrorTexture); +/// mirrorTexture = nullptr; +/// \endcode +/// /// \see ovr_GetMirrorTextureBufferDX /// \see ovr_DestroyMirrorTexture /// @@ -120,6 +135,15 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateMirrorTextureDX(ovrSession session, /// \return Returns an ovrResult indicating success or failure. In the case of failure, use /// ovr_GetLastErrorInfo to get more information. /// +/// <b>Example code</b> +/// \code{.cpp} +/// ID3D11Texture2D* d3d11Texture = nullptr; +/// ovr_GetMirrorTextureBufferDX(session, mirrorTexture, IID_PPV_ARGS(&d3d11Texture)); +/// d3d11DeviceContext->CopyResource(d3d11TextureBackBuffer, d3d11Texture); +/// d3d11Texture->Release(); +/// dxgiSwapChain->Present(0, 0); +/// \endcode +/// OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetMirrorTextureBufferDX(ovrSession session, ovrMirrorTexture mirrorTexture, IID iid, diff --git a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_ErrorCode.h b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_ErrorCode.h index 3d406174..ed0be0e7 100644 --- a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_ErrorCode.h +++ b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_ErrorCode.h @@ -91,6 +91,7 @@ typedef enum ovrErrorType_ ovrError_InvalidHeadsetOrientation = -1011, ///< The headset was in an invalid orientation for the requested operation (e.g. vertically oriented during ovr_RecenterPose). ovrError_ClientSkippedDestroy = -1012, ///< The client failed to call ovr_Destroy on an active session before calling ovr_Shutdown. Or the client crashed. ovrError_ClientSkippedShutdown = -1013, ///< The client failed to call ovr_Shutdown or the client crashed. + ovrError_ServiceDeadlockDetected = -1014, ///< The service watchdog discovered a deadlock. /* Audio error range, reserved for Audio errors. */ ovrError_AudioReservedBegin = -2000, ///< First Audio error. @@ -140,25 +141,42 @@ typedef enum ovrErrorType_ ovrError_NordicEnabledNoSync = -4015, ///< The nordic indicates that sync is enabled but it is not sending sync pulses ovrError_NordicSyncNoFrames = -4016, ///< It looks like we're getting a sync signal, but no camera frames have been received ovrError_CatastrophicFailure = -4017, ///< A catastrophic failure has occurred. We will attempt to recover by resetting the device + ovrError_CatastrophicTimeout = -4018, ///< The catastrophic recovery has timed out. + ovrError_RepeatCatastrophicFail = -4019, ///< Catastrophic failure has repeated too many times. + ovrError_USBOpenDeviceFailure = -4020, ///< Could not open handle for Rift device (likely already in use by another process). + ovrError_HMDGeneralFailure = -4021, ///< Unexpected HMD issues that don't fit a specific bucket. ovrError_HMDFirmwareMismatch = -4100, ///< The HMD Firmware is out of date and is unacceptable. ovrError_TrackerFirmwareMismatch = -4101, ///< The sensor Firmware is out of date and is unacceptable. ovrError_BootloaderDeviceDetected = -4102, ///< A bootloader HMD is detected by the service. ovrError_TrackerCalibrationError = -4103, ///< The sensor calibration is missing or incorrect. ovrError_ControllerFirmwareMismatch = -4104, ///< The controller firmware is out of date and is unacceptable. + ovrError_DevManDeviceDetected = -4105, ///< A DeviceManagement mode HMD is detected by the service. + ovrError_RebootedBootloaderDevice = -4106, ///< Had to reboot bootloader device, which succeeded. + ovrError_FailedRebootBootloaderDev = -4107, ///< Had to reboot bootloader device, which failed. Device is stuck in bootloader mode. ovrError_IMUTooManyLostSamples = -4200, ///< Too many lost IMU samples. ovrError_IMURateError = -4201, ///< IMU rate is outside of the expected range. ovrError_FeatureReportFailure = -4202, ///< A feature report has failed. + ovrError_HMDWirelessTimeout = -4203, ///< HMD wireless interface never returned from busy state. + + ovrError_BootloaderAssertLog = -4300, ///< HMD Bootloader Assert Log was not empty. + ovrError_AppAssertLog = -4301, ///< HMD App Assert Log was not empty. /* Synchronization errors */ - ovrError_Incomplete = -5000, ///<Requested async work not yet complete. - ovrError_Abandoned = -5001, ///<Requested async work was abandoned and result is incomplete. + ovrError_Incomplete = -5000, ///< Requested async work not yet complete. + ovrError_Abandoned = -5001, ///< Requested async work was abandoned and result is incomplete. /* Rendering errors */ - ovrError_DisplayLost = -6000, ///<In the event of a system-wide graphics reset or cable unplug this is returned to the app. - ovrError_TextureSwapChainFull = -6001, ///<ovr_CommitTextureSwapChain was called too many times on a texture swapchain without calling submit to use the chain. - ovrError_TextureSwapChainInvalid = -6002, ///<The ovrTextureSwapChain is in an incomplete or inconsistent state. Ensure ovr_CommitTextureSwapChain was called at least once first. + ovrError_DisplayLost = -6000, ///< In the event of a system-wide graphics reset or cable unplug this is returned to the app. + ovrError_TextureSwapChainFull = -6001, ///< ovr_CommitTextureSwapChain was called too many times on a texture swapchain without calling submit to use the chain. + ovrError_TextureSwapChainInvalid = -6002, ///< The ovrTextureSwapChain is in an incomplete or inconsistent state. Ensure ovr_CommitTextureSwapChain was called at least once first. + ovrError_GraphicsDeviceReset = -6003, ///< Graphics device has been reset (TDR, etc...) + ovrError_DisplayRemoved = -6004, ///< HMD removed from the display adapter + ovrError_ContentProtectionNotAvailable = -6005,///<Content protection is not available for the display + ovrError_ApplicationInvisible = -6006, ///< Application declared itself as an invisible type and is not allowed to submit frames. + ovrError_Disallowed = -6007, ///< The given request is disallowed under the current conditions. + ovrError_DisplayPluggedIncorrectly = -6008, ///< Display portion of HMD is plugged into an incompatible port (ex: IGP) /* Fatal errors */ ovrError_RuntimeException = -7000, ///< A runtime exception occurred. The application is required to shutdown LibOVR and re-initialize it before this error state will be cleared. diff --git a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_Version.h b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_Version.h index 2a0968a8..dbfe4deb 100644 --- a/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_Version.h +++ b/examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_Version.h @@ -19,7 +19,7 @@ // Master version numbers #define OVR_PRODUCT_VERSION 1 // Product version doesn't participate in semantic versioning. #define OVR_MAJOR_VERSION 1 // If you change these values then you need to also make sure to change LibOVR/Projects/Windows/LibOVR.props in parallel. -#define OVR_MINOR_VERSION 3 // +#define OVR_MINOR_VERSION 4 // #define OVR_PATCH_VERSION 0 #define OVR_BUILD_NUMBER 0 |
