aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/CAPI
diff options
context:
space:
mode:
Diffstat (limited to 'LibOVR/Src/CAPI')
-rw-r--r--LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp6
-rwxr-xr-xLibOVR/Src/CAPI/CAPI_HMDState.cpp16
-rwxr-xr-xLibOVR/Src/CAPI/CAPI_HMDState.h4
3 files changed, 26 insertions, 0 deletions
diff --git a/LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp b/LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp
index 4b61ba5..a4e9e0d 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.
@@ -35,6 +36,7 @@ limitations under the License.
#endif
#include "GL/CAPI_GL_DistortionRenderer.h"
+#endif /* !defined(HEADLESS_APP) */
namespace OVR { namespace CAPI {
@@ -46,6 +48,7 @@ namespace OVR { namespace CAPI {
DistortionRenderer::CreateFunc DistortionRenderer::APICreateRegistry[ovrRenderAPI_Count] =
{
+#if !defined(HEADLESS_APP)
0, // None
&GL::DistortionRenderer::Create,
0, // Android_GLES
@@ -58,6 +61,9 @@ DistortionRenderer::CreateFunc DistortionRenderer::APICreateRegistry[ovrRenderAP
0,
0
#endif
+#else /* !defined(HEADLESS_APP) */
+ 0 // None
+#endif /* !defined(HEADLESS_APP) */
};
DistortionRenderer::DistortionRenderer() :
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;
}
diff --git a/LibOVR/Src/CAPI/CAPI_HMDState.h b/LibOVR/Src/CAPI/CAPI_HMDState.h
index 18342bb..c8b521e 100755
--- a/LibOVR/Src/CAPI/CAPI_HMDState.h
+++ b/LibOVR/Src/CAPI/CAPI_HMDState.h
@@ -37,7 +37,9 @@ limitations under the License.
#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"
@@ -294,8 +296,10 @@ public:
HMDRenderState RenderState;
Ptr<DistortionRenderer> pRenderer;
+#if !defined(HEADLESS_APP)
// Health and Safety Warning display.
Ptr<HSWDisplay> pHSWDisplay;
+#endif /* !defined(HEADLESS_APP) */
// Last cached value returned by ovrHmd_GetString/ovrHmd_GetStringArray.
char LastGetStringValue[256];