aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/OVR_CAPI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'LibOVR/Src/OVR_CAPI.cpp')
-rwxr-xr-xLibOVR/Src/OVR_CAPI.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/LibOVR/Src/OVR_CAPI.cpp b/LibOVR/Src/OVR_CAPI.cpp
index d451ad8..c530f82 100755
--- a/LibOVR/Src/OVR_CAPI.cpp
+++ b/LibOVR/Src/OVR_CAPI.cpp
@@ -45,10 +45,12 @@ limitations under the License.
#include "Displays/OVR_Display.h"
+#if !defined(HEADLESS_APP)
#if defined(OVR_OS_WIN32)
#include "Displays/OVR_Win32_ShimFunctions.h"
#include <VersionHelpers.h>
#endif
+#endif /* !defined(HEADLESS_APP) */
// Forward decl to keep the callback static
@@ -174,6 +176,7 @@ static ovrBool CAPI_ovrInitializeCalled = ovrFalse;
static OVR::Service::NetClient* CAPI_pNetClient = nullptr;
+#if !defined(HEADLESS_APP)
ovrBool ovr_InitializeRenderingShim()
{
OVR::Display::Initialize();
@@ -191,6 +194,7 @@ OVR_PUBLIC_FUNCTION(ovrBool) ovr_InitializeRenderingShimVersion(int requestedMin
return ovr_InitializeRenderingShim();
}
+#endif /* !defined(HEADLESS_APP) */
// Write out to the log where the current running module is located on disk.
static void LogLocationOfThisModule()
@@ -443,6 +447,7 @@ OVR_PUBLIC_FUNCTION(ovrHmd) ovrHmd_Create(int index)
return hmds->pHmdDesc;
}
+#if !defined(HEADLESS_APP)
OVR_PUBLIC_FUNCTION(ovrBool) ovrHmd_AttachToWindow(ovrHmd hmddesc, void* window,
const ovrRecti* destMirrorRect,
@@ -471,6 +476,8 @@ OVR_PUBLIC_FUNCTION(ovrBool) ovrHmd_AttachToWindow(ovrHmd hmddesc, void* window,
return ovrTrue;
}
+#endif /* !defined(HEADLESS_APP) */
+
OVR_PUBLIC_FUNCTION(ovrHmd) ovrHmd_CreateDebug(ovrHmdType type)
{
if (!CAPI_ovrInitializeCalled)
@@ -494,6 +501,7 @@ OVR_PUBLIC_FUNCTION(void) ovrHmd_Destroy(ovrHmd hmddesc)
ThreadChecker::Scope checkScope(&hmds->RenderAPIThreadChecker, "ovrHmd_Destroy");
}
+#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
if (hmds->pWindow)
{
@@ -503,6 +511,7 @@ OVR_PUBLIC_FUNCTION(void) ovrHmd_Destroy(ovrHmd hmddesc)
Win32::DisplayShim::GetInstance().hWindow = (HWND)0;
}
#endif
+#endif /* !defined(HEADLESS_APP) */
delete (HMDState*)hmddesc->Handle;
}
@@ -694,6 +703,7 @@ OVR_PUBLIC_FUNCTION(void) ovrHmd_EndFrame(ovrHmd hmddesc,
{
hmds->pRenderer->SaveGraphicsState();
+#if !defined(HEADLESS_APP)
// See if we need to show the HSWDisplay.
if (hmds->pHSWDisplay) // Until we know that these are valid, assume any of them can't be.
{
@@ -706,6 +716,7 @@ OVR_PUBLIC_FUNCTION(void) ovrHmd_EndFrame(ovrHmd hmddesc,
hmds->pHSWDisplay->Render(ovrEye_Right, &eyeTexture[ovrEye_Right]);
}
}
+#endif /* !defined(HEADLESS_APP) */
if (posTimewarpDesc)
hmds->pRenderer->SetPositionTimewarpDesc(*posTimewarpDesc);
@@ -725,6 +736,7 @@ OVR_PUBLIC_FUNCTION(void) ovrHmd_EndFrame(ovrHmd hmddesc,
hmds->BeginFrameIndex++; // Set frame index to the next value in case 0 is passed.
}
+#if !defined(HEADLESS_APP)
// Not exposed as part of public API
OVR_PUBLIC_FUNCTION(void) ovrHmd_RegisterPostDistortionCallback(ovrHmd hmddesc, PostDistortionCallback callback)
{
@@ -734,6 +746,7 @@ OVR_PUBLIC_FUNCTION(void) ovrHmd_RegisterPostDistortionCallback(ovrHmd hmddesc,
hmds->pRenderer->RegisterPostDistortionCallback(callback);
}
+#endif /* !defined(HEADLESS_APP) */
@@ -943,7 +956,11 @@ OVR_PUBLIC_FUNCTION(ovrEyeRenderDesc) ovrHmd_GetRenderDesc(ovrHmd hmddesc,
}
-#define OVR_OFFSET_OF(s, field) ((size_t)&((s*)0)->field)
+#if defined(OVR_CC_MSVC)
+ #define OVR_OFFSET_OF(s, field) ((size_t)&((s*)0)->field)
+#else
+ #define OVR_OFFSET_OF(s, field) (1)
+#endif
OVR_PUBLIC_FUNCTION(ovrBool) ovrHmd_CreateDistortionMeshDebug(ovrHmd hmddesc,
@@ -1123,6 +1140,8 @@ OVR_PUBLIC_FUNCTION(double) ovrHmd_GetMeasuredLatencyTest2(ovrHmd hmddesc)
// ***** Health and Safety Warning Display interface
//
+#if !defined(HEADLESS_APP)
+
OVR_PUBLIC_FUNCTION(void) ovrHmd_GetHSWDisplayState(ovrHmd hmddesc, ovrHSWDisplayState *hswDisplayState)
{
if (!hswDisplayState)
@@ -1155,6 +1174,7 @@ OVR_PUBLIC_FUNCTION(ovrBool) ovrHmd_DismissHSWDisplay(ovrHmd hmddesc)
return ovrFalse;
}
+#endif /* !defined(HEADLESS_APP) */
// -----------------------------------------------------------------------------------
// ***** Property Access