diff options
author | Sven Gothel <[email protected]> | 2015-07-14 07:12:13 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-07-14 07:12:13 +0200 |
commit | a352ecb7e63304034ac93332cf0c4d9183df867e (patch) | |
tree | 56d7754f7cfff8d728ced75c2a05d6fcd54dcae5 /LibOVR/Src | |
parent | 450aa6f7df9e67dd256b86f94e65eaf707032aad (diff) |
Fix compilation / linkage of 0.5.0.1 HEADLESS_APP mode
Tested: GNU/Linux and OSX
Diffstat (limited to 'LibOVR/Src')
-rwxr-xr-x | LibOVR/Src/CAPI/CAPI_HMDState.cpp | 13 | ||||
-rwxr-xr-x | LibOVR/Src/OVR_CAPI.cpp | 17 |
2 files changed, 23 insertions, 7 deletions
diff --git a/LibOVR/Src/CAPI/CAPI_HMDState.cpp b/LibOVR/Src/CAPI/CAPI_HMDState.cpp index 7a00bf8..fede019 100755 --- a/LibOVR/Src/CAPI/CAPI_HMDState.cpp +++ b/LibOVR/Src/CAPI/CAPI_HMDState.cpp @@ -146,6 +146,7 @@ HMDState::HMDState(HMDInfo const & hmdInfo, { pHSWDisplay = *OVR::CAPI::HSWDisplay::Factory(ovrRenderAPI_None, pHmdDesc, RenderState); } +#endif /* !defined(HEADLESS_APP) */ RenderIMUTimeSeconds = 0.; @@ -173,7 +174,6 @@ HMDState::~HMDState() OVR_FREE(pHmdDesc); pHmdDesc = nullptr; } -#endif /* !defined(HEADLESS_APP) */ } bool HMDState::InitializeSharedState() @@ -950,13 +950,18 @@ bool HMDState::ConfigureRendering(ovrEyeRenderDesc eyeRenderDescOut[2], if (!pRenderer) { +#if !defined(HEADLESS_APP) pRenderer = *DistortionRenderer::APICreateRegistry [apiConfig->Header.API](); +#endif /* !defined(HEADLESS_APP) */ } - if (!pRenderer || - !pRenderer->Initialize(apiConfig, &TheTrackingStateReader, - &TimewarpTimer, &RenderState)) + if (!pRenderer +#if !defined(HEADLESS_APP) + || !pRenderer->Initialize(apiConfig, &TheTrackingStateReader, + &TimewarpTimer, &RenderState) +#endif /* !defined(HEADLESS_APP) */ + ) { RenderingConfigured = false; return false; diff --git a/LibOVR/Src/OVR_CAPI.cpp b/LibOVR/Src/OVR_CAPI.cpp index c530f82..e02151a 100755 --- a/LibOVR/Src/OVR_CAPI.cpp +++ b/LibOVR/Src/OVR_CAPI.cpp @@ -695,7 +695,12 @@ OVR_PUBLIC_FUNCTION(void) ovrHmd_EndFrame(ovrHmd hmddesc, hmds->checkBeginFrameScope("ovrHmd_EndFrame"); ThreadChecker::Scope checkScope(&hmds->RenderAPIThreadChecker, "ovrHmd_EndFrame"); - hmds->pRenderer->SetLatencyTestColor(hmds->LatencyTestActive ? hmds->LatencyTestDrawColor : nullptr); +#if !defined(HEADLESS_APP) + if (hmds->pRenderer) + { + hmds->pRenderer->SetLatencyTestColor(hmds->LatencyTestActive ? hmds->LatencyTestDrawColor : nullptr); + } +#endif /* !defined(HEADLESS_APP) */ ovrHmd_GetLatencyTest2DrawColor(hmddesc, nullptr); // We don't actually need to draw color, so send nullptr @@ -1111,13 +1116,19 @@ OVR_PUBLIC_FUNCTION(ovrBool) ovrHmd_GetLatencyTest2DrawColor(ovrHmd hmddesc, uns rgbColorOut[2] = hmds->LatencyTest2DrawColor[2]; } - if (hmds->pRenderer) +#if !defined(HEADLESS_APP) + if (hmds->pRenderer) { hmds->pRenderer->SetLatencyTest2Color(hmds->LatencyTest2DrawColor); + } +#endif /* !defined(HEADLESS_APP) */ } else { - if (hmds->pRenderer) +#if !defined(HEADLESS_APP) + if (hmds->pRenderer) { hmds->pRenderer->SetLatencyTest2Color(nullptr); + } +#endif /* !defined(HEADLESS_APP) */ } return dk2LatencyTest ? ovrTrue : ovrFalse; |