diff options
Diffstat (limited to 'LibOVR/Src/CAPI/CAPI_HMDState.cpp')
-rwxr-xr-x | LibOVR/Src/CAPI/CAPI_HMDState.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/LibOVR/Src/CAPI/CAPI_HMDState.cpp b/LibOVR/Src/CAPI/CAPI_HMDState.cpp index 4aae646..7a00bf8 100755 --- a/LibOVR/Src/CAPI/CAPI_HMDState.cpp +++ b/LibOVR/Src/CAPI/CAPI_HMDState.cpp @@ -28,6 +28,7 @@ limitations under the License. #include "../OVR_Profile.h" #include "../Service/Service_NetClient.h" +#if !defined(HEADLESS_APP) #ifdef OVR_OS_WIN32 #include "../Displays/OVR_Win32_ShimFunctions.h" @@ -41,6 +42,7 @@ limitations under the License. #include "../Displays/OVR_Linux_SDKWindow.h" // For screen rotation #endif +#endif /* !defined(HEADLESS_APP) */ #include "Tracing/Tracing.h" @@ -83,7 +85,9 @@ HMDState::HMDState(HMDInfo const & hmdInfo, ScreenLatencyTracker(), RenderState(), pRenderer(), +#if !defined(HEADLESS_APP) pHSWDisplay(), +#endif /* !defined(HEADLESS_APP) */ //LastGetStringValue(), RenderingConfigured(false), BeginFrameCalled(false), @@ -136,6 +140,7 @@ HMDState::HMDState(HMDInfo const & hmdInfo, 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) { @@ -168,6 +173,7 @@ HMDState::~HMDState() OVR_FREE(pHmdDesc); pHmdDesc = nullptr; } +#endif /* !defined(HEADLESS_APP) */ } bool HMDState::InitializeSharedState() @@ -279,6 +285,7 @@ HMDState* HMDState::CreateHMDState(NetClient* client, const HMDNetworkInfo& netI return nullptr; } +#if !defined(HEADLESS_APP) #ifdef OVR_OS_WIN32 OVR_DEBUG_LOG(("[HMDState] Setting up display shim")); @@ -286,6 +293,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(("[HMDState] Using profile %s", pDefaultProfile->GetValue(OVR_KEY_USER))); @@ -385,6 +393,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; @@ -393,6 +402,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 @@ -895,11 +905,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(); @@ -911,11 +923,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(); @@ -948,6 +962,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. { @@ -1024,6 +1039,7 @@ OVR_RESTORE_MSVC_WARNING() } } #endif +#endif /* !defined(HEADLESS_APP) */ return true; } |