aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVR/Src
diff options
context:
space:
mode:
Diffstat (limited to 'LibOVR/Src')
-rwxr-xr-xLibOVR/Src/CAPI/CAPI_HMDState.cpp13
-rwxr-xr-xLibOVR/Src/OVR_CAPI.cpp17
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;