diff options
Diffstat (limited to 'LibOVR/Src/CAPI')
-rw-r--r-- | LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp | 6 | ||||
-rw-r--r-- | LibOVR/Src/CAPI/CAPI_HMDState.cpp | 18 | ||||
-rw-r--r-- | LibOVR/Src/CAPI/CAPI_HMDState.h | 4 |
3 files changed, 28 insertions, 0 deletions
diff --git a/LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp b/LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp index 78e49e7..262d4db 100644 --- a/LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp +++ b/LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp @@ -26,6 +26,7 @@ limitations under the License. #include "CAPI_DistortionRenderer.h" +#if !defined(HEADLESS_APP) #if defined (OVR_OS_WIN32) // TBD: Move to separate config file that handles back-ends. @@ -44,6 +45,7 @@ limitations under the License. #endif #include "GL/CAPI_GL_DistortionRenderer.h" +#endif /* !defined(HEADLESS_APP) */ namespace OVR { namespace CAPI { @@ -54,6 +56,7 @@ namespace OVR { namespace CAPI { DistortionRenderer::CreateFunc DistortionRenderer::APICreateRegistry[ovrRenderAPI_Count] = { +#if !defined(HEADLESS_APP) 0, // None &GL::DistortionRenderer::Create, 0, // Android_GLES @@ -66,6 +69,9 @@ DistortionRenderer::CreateFunc DistortionRenderer::APICreateRegistry[ovrRenderAP 0, 0 #endif +#else /* !defined(HEADLESS_APP) */ + 0 // None +#endif /* !defined(HEADLESS_APP) */ }; void DistortionRenderer::SetLatencyTestColor(unsigned char* color) diff --git a/LibOVR/Src/CAPI/CAPI_HMDState.cpp b/LibOVR/Src/CAPI/CAPI_HMDState.cpp index 6ea9958..923abe0 100644 --- a/LibOVR/Src/CAPI/CAPI_HMDState.cpp +++ b/LibOVR/Src/CAPI/CAPI_HMDState.cpp @@ -27,9 +27,11 @@ limitations under the License. #include "CAPI_HMDState.h" #include "../OVR_Profile.h" #include "../Service/Service_NetClient.h" +#if !defined(HEADLESS_APP) #ifdef OVR_OS_WIN32 #include "../Displays/OVR_Win32_ShimFunctions.h" #endif +#endif /* !defined(HEADLESS_APP) */ namespace OVR { namespace CAPI { @@ -66,7 +68,9 @@ HMDState::HMDState(const OVR::Service::HMDNetworkInfo& netInfo, TimeManager(true), RenderState(), pRenderer(), +#if !defined(HEADLESS_APP) pHSWDisplay(), +#endif /* !defined(HEADLESS_APP) */ LastFrameTimeSeconds(0.), LastGetFrameTimeSeconds(0.), //LastGetStringValue(), @@ -102,7 +106,9 @@ HMDState::HMDState(const OVR::HMDInfo& hmdInfo, Profile* profile) : TimeManager(true), RenderState(), pRenderer(), +#if !defined(HEADLESS_APP) pHSWDisplay(), +#endif /* !defined(HEADLESS_APP) */ LastFrameTimeSeconds(0.), LastGetFrameTimeSeconds(0.), //LastGetStringValue(), @@ -170,12 +176,14 @@ void HMDState::sharedInit(Profile* profile) BeginFrameThreadId = 0; BeginFrameTimingCalled = false; +#if !defined(HEADLESS_APP) // Construct the HSWDisplay. We will later reconstruct it with a specific ovrRenderAPI type if the application starts using SDK-based rendering. if(!pHSWDisplay) { pHSWDisplay = *OVR::CAPI::HSWDisplay::Factory(ovrRenderAPI_None, pHmdDesc, RenderState); pHSWDisplay->Enable(pProfile->GetBoolValue("HSW", true)); } +#endif /* !defined(HEADLESS_APP) */ } static Vector3f GetNeckModelFromProfile(Profile* profile) @@ -264,6 +272,7 @@ HMDState* HMDState::CreateHMDState(NetClient* client, const HMDNetworkInfo& netI return NULL; } +#if !defined(HEADLESS_APP) #ifdef OVR_OS_WIN32 OVR_DEBUG_LOG(("Setting up display shim")); @@ -271,6 +280,7 @@ HMDState* HMDState::CreateHMDState(NetClient* client, const HMDNetworkInfo& netI // so that this will happen before the D3D display object is created. Win32::DisplayShim::GetInstance().Update(&hinfo.ShimInfo); #endif +#endif /* !defined(HEADLESS_APP) */ Ptr<Profile> pDefaultProfile = *ProfileManager::GetInstance()->GetDefaultUserProfile(&hinfo); OVR_DEBUG_LOG(("Using profile %s", pDefaultProfile->GetValue(OVR_KEY_USER))); @@ -377,6 +387,7 @@ void HMDState::SetEnabledHmdCaps(unsigned hmdCaps) if ((EnabledHmdCaps ^ hmdCaps) & ovrHmdCap_NoMirrorToWindow) { +#if !defined(HEADLESS_APP) #ifdef OVR_OS_WIN32 Win32::DisplayShim::GetInstance().UseMirroring = (hmdCaps & ovrHmdCap_NoMirrorToWindow) ? false : true; @@ -385,6 +396,7 @@ void HMDState::SetEnabledHmdCaps(unsigned hmdCaps) ::InvalidateRect((HWND)pWindow, 0, true); } #endif +#endif /* !defined(HEADLESS_APP) */ } // TBD: Should this include be only the rendering flags? Otherwise, bits that failed @@ -660,11 +672,13 @@ bool HMDState::ConfigureRendering(ovrEyeRenderDesc eyeRenderDescOut[2], // null -> shut down. if (!apiConfig) { +#if !defined(HEADLESS_APP) if (pHSWDisplay) { pHSWDisplay->Shutdown(); pHSWDisplay.Clear(); } +#endif /* !defined(HEADLESS_APP) */ if (pRenderer) pRenderer.Clear(); @@ -676,11 +690,13 @@ bool HMDState::ConfigureRendering(ovrEyeRenderDesc eyeRenderDescOut[2], (apiConfig->Header.API != pRenderer->GetRenderAPI())) { // Shutdown old renderer. +#if !defined(HEADLESS_APP) if (pHSWDisplay) { pHSWDisplay->Shutdown(); pHSWDisplay.Clear(); } +#endif /* !defined(HEADLESS_APP) */ if (pRenderer) pRenderer.Clear(); @@ -718,6 +734,7 @@ bool HMDState::ConfigureRendering(ovrEyeRenderDesc eyeRenderDescOut[2], return false; } +#if !defined(HEADLESS_APP) // Setup the Health and Safety Warning display system. if(pHSWDisplay && (pHSWDisplay->GetRenderAPIType() != apiConfig->Header.API)) // If we need to reconstruct the HSWDisplay for a different graphics API type, delete the existing display. { @@ -733,6 +750,7 @@ bool HMDState::ConfigureRendering(ovrEyeRenderDesc eyeRenderDescOut[2], if (pHSWDisplay) pHSWDisplay->Initialize(apiConfig); // This is potentially re-initializing it with a new config. +#endif /* !defined(HEADLESS_APP) */ return true; } diff --git a/LibOVR/Src/CAPI/CAPI_HMDState.h b/LibOVR/Src/CAPI/CAPI_HMDState.h index 81ca64f..ec96bdf 100644 --- a/LibOVR/Src/CAPI/CAPI_HMDState.h +++ b/LibOVR/Src/CAPI/CAPI_HMDState.h @@ -36,7 +36,9 @@ limitations under the License. #include "CAPI_LatencyStatistics.h" #include "CAPI_HMDRenderState.h" #include "CAPI_DistortionRenderer.h" +#if !defined(HEADLESS_APP) #include "CAPI_HSWDisplay.h" +#endif /* !defined(HEADLESS_APP) */ #include "../Service/Service_NetClient.h" #include "../Net/OVR_NetworkTypes.h" @@ -261,8 +263,10 @@ public: HMDRenderState RenderState; Ptr<DistortionRenderer> pRenderer; +#if !defined(HEADLESS_APP) // Health and Safety Warning display. Ptr<HSWDisplay> pHSWDisplay; +#endif /* !defined(HEADLESS_APP) */ // Last timing value reported by BeginFrame. double LastFrameTimeSeconds; |