summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-27 02:57:20 +0100
committerSven Gothel <[email protected]>2015-03-27 02:57:20 +0100
commit3c7b8a17e907f4ef2afd9f77db566a3f6179cbe4 (patch)
treedf5c8e4665669de2bf1b88af6d93db4599c29d1d
parent633f70342fe270fd91bca8f724049aceec602337 (diff)
Bug 1116: Oculus SDK 0.4.4 support for JOGL: Use new 'HEADLESS_APP' mode, i.e. drop all display related code.v2.3.1jogamp_0.4.4
HEADLESS_APP (new CPP define) is required to drop all display related code. TODO: JOGL needs to display the HSW (Health and Safety Warning) messages to comply w/ license!
-rw-r--r--LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp6
-rw-r--r--LibOVR/Src/CAPI/CAPI_HMDState.cpp18
-rw-r--r--LibOVR/Src/CAPI/CAPI_HMDState.h4
-rw-r--r--LibOVR/Src/Displays/OVR_Win32_Dxgi_Display.h22
-rw-r--r--LibOVR/Src/Kernel/OVR_Log.cpp2
-rw-r--r--LibOVR/Src/Kernel/OVR_System.cpp6
-rw-r--r--LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp2
-rw-r--r--LibOVR/Src/Kernel/OVR_Types.h26
-rw-r--r--LibOVR/Src/OVR_CAPI.cpp18
-rw-r--r--LibOVR/Src/OVR_CAPI.h13
10 files changed, 115 insertions, 2 deletions
diff --git a/LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp b/LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp
index 78e49e7..262d4db 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.
@@ -44,6 +45,7 @@ limitations under the License.
#endif
#include "GL/CAPI_GL_DistortionRenderer.h"
+#endif /* !defined(HEADLESS_APP) */
namespace OVR { namespace CAPI {
@@ -54,6 +56,7 @@ namespace OVR { namespace CAPI {
DistortionRenderer::CreateFunc DistortionRenderer::APICreateRegistry[ovrRenderAPI_Count] =
{
+#if !defined(HEADLESS_APP)
0, // None
&GL::DistortionRenderer::Create,
0, // Android_GLES
@@ -66,6 +69,9 @@ DistortionRenderer::CreateFunc DistortionRenderer::APICreateRegistry[ovrRenderAP
0,
0
#endif
+#else /* !defined(HEADLESS_APP) */
+ 0 // None
+#endif /* !defined(HEADLESS_APP) */
};
void DistortionRenderer::SetLatencyTestColor(unsigned char* color)
diff --git a/LibOVR/Src/CAPI/CAPI_HMDState.cpp b/LibOVR/Src/CAPI/CAPI_HMDState.cpp
index 6ea9958..923abe0 100644
--- a/LibOVR/Src/CAPI/CAPI_HMDState.cpp
+++ b/LibOVR/Src/CAPI/CAPI_HMDState.cpp
@@ -27,9 +27,11 @@ limitations under the License.
#include "CAPI_HMDState.h"
#include "../OVR_Profile.h"
#include "../Service/Service_NetClient.h"
+#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
#include "../Displays/OVR_Win32_ShimFunctions.h"
#endif
+#endif /* !defined(HEADLESS_APP) */
namespace OVR { namespace CAPI {
@@ -66,7 +68,9 @@ HMDState::HMDState(const OVR::Service::HMDNetworkInfo& netInfo,
TimeManager(true),
RenderState(),
pRenderer(),
+#if !defined(HEADLESS_APP)
pHSWDisplay(),
+#endif /* !defined(HEADLESS_APP) */
LastFrameTimeSeconds(0.),
LastGetFrameTimeSeconds(0.),
//LastGetStringValue(),
@@ -102,7 +106,9 @@ HMDState::HMDState(const OVR::HMDInfo& hmdInfo, Profile* profile) :
TimeManager(true),
RenderState(),
pRenderer(),
+#if !defined(HEADLESS_APP)
pHSWDisplay(),
+#endif /* !defined(HEADLESS_APP) */
LastFrameTimeSeconds(0.),
LastGetFrameTimeSeconds(0.),
//LastGetStringValue(),
@@ -170,12 +176,14 @@ void HMDState::sharedInit(Profile* profile)
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)
{
pHSWDisplay = *OVR::CAPI::HSWDisplay::Factory(ovrRenderAPI_None, pHmdDesc, RenderState);
pHSWDisplay->Enable(pProfile->GetBoolValue("HSW", true));
}
+#endif /* !defined(HEADLESS_APP) */
}
static Vector3f GetNeckModelFromProfile(Profile* profile)
@@ -264,6 +272,7 @@ HMDState* HMDState::CreateHMDState(NetClient* client, const HMDNetworkInfo& netI
return NULL;
}
+#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
OVR_DEBUG_LOG(("Setting up display shim"));
@@ -271,6 +280,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(("Using profile %s", pDefaultProfile->GetValue(OVR_KEY_USER)));
@@ -377,6 +387,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;
@@ -385,6 +396,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
@@ -660,11 +672,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();
@@ -676,11 +690,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();
@@ -718,6 +734,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.
{
@@ -733,6 +750,7 @@ bool HMDState::ConfigureRendering(ovrEyeRenderDesc eyeRenderDescOut[2],
if (pHSWDisplay)
pHSWDisplay->Initialize(apiConfig); // This is potentially re-initializing it with a new config.
+#endif /* !defined(HEADLESS_APP) */
return true;
}
diff --git a/LibOVR/Src/CAPI/CAPI_HMDState.h b/LibOVR/Src/CAPI/CAPI_HMDState.h
index 81ca64f..ec96bdf 100644
--- a/LibOVR/Src/CAPI/CAPI_HMDState.h
+++ b/LibOVR/Src/CAPI/CAPI_HMDState.h
@@ -36,7 +36,9 @@ limitations under the License.
#include "CAPI_LatencyStatistics.h"
#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"
@@ -261,8 +263,10 @@ public:
HMDRenderState RenderState;
Ptr<DistortionRenderer> pRenderer;
+#if !defined(HEADLESS_APP)
// Health and Safety Warning display.
Ptr<HSWDisplay> pHSWDisplay;
+#endif /* !defined(HEADLESS_APP) */
// Last timing value reported by BeginFrame.
double LastFrameTimeSeconds;
diff --git a/LibOVR/Src/Displays/OVR_Win32_Dxgi_Display.h b/LibOVR/Src/Displays/OVR_Win32_Dxgi_Display.h
index e801f4a..097a501 100644
--- a/LibOVR/Src/Displays/OVR_Win32_Dxgi_Display.h
+++ b/LibOVR/Src/Displays/OVR_Win32_Dxgi_Display.h
@@ -81,6 +81,8 @@ typedef BOOL (WINAPI *WinGetModuleHandleExW)( DWORD, LPCWSTR, HMODULE* );
typedef void* (WINAPI *WinDirect3DCreate9)(UINT SDKVersion);
typedef HRESULT (WINAPI *WinDirect3DCreate9Ex)(UINT SDKVersion, void** aDevice);
+#if !defined(HEADLESS_APP)
+
// Overridden DXGI entry points
typedef HRESULT (WINAPI *WinCreateDXGIFactory)(
__in REFIID riid,
@@ -98,6 +100,26 @@ typedef HRESULT (WINAPI *WinCreateDXGIFactory2)(
__out void **ppFactory
);
+#else /* !defined(HEADLESS_APP) */
+
+typedef HRESULT (WINAPI *WinCreateDXGIFactory)(
+ void ** riid,
+ void **ppFactory
+ );
+
+typedef HRESULT (WINAPI *WinCreateDXGIFactory1)(
+ void ** riid,
+ void **ppFactory
+ );
+
+typedef HRESULT (WINAPI *WinCreateDXGIFactory2)(
+ UINT flags,
+ const IID &riid,
+ void **ppFactory
+ );
+
+#endif /* !defined(HEADLESS_APP) */
+
// Application usermode callbacks from usermode driver. These
// functions are all provided by the calling application that uses
// the filter mode driver
diff --git a/LibOVR/Src/Kernel/OVR_Log.cpp b/LibOVR/Src/Kernel/OVR_Log.cpp
index 2631879..34cc605 100644
--- a/LibOVR/Src/Kernel/OVR_Log.cpp
+++ b/LibOVR/Src/Kernel/OVR_Log.cpp
@@ -397,11 +397,13 @@ void SetAssertionHandler(OVRAssertionHandler assertionHandler, intptr_t userPara
intptr_t DefaultAssertionHandler(intptr_t /*userParameter*/, const char* title, const char* message)
{
+#if !defined(HEADLESS_APP)
if(OVRIsDebuggerPresent())
{
OVR_DEBUG_BREAK;
}
else
+#endif /* !defined(HEADLESS_APP) */
{
#if defined(OVR_BUILD_DEBUG)
// Print a stack trace of all threads.
diff --git a/LibOVR/Src/Kernel/OVR_System.cpp b/LibOVR/Src/Kernel/OVR_System.cpp
index 66c764a..c8c7b87 100644
--- a/LibOVR/Src/Kernel/OVR_System.cpp
+++ b/LibOVR/Src/Kernel/OVR_System.cpp
@@ -29,9 +29,11 @@ limitations under the License.
#include "OVR_Threads.h"
#include "OVR_Timer.h"
#include "../Displays/OVR_Display.h"
+#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
#include "../Displays/OVR_Win32_ShimFunctions.h"
#endif
+#endif /* !defined(HEADLESS_APP) */
namespace OVR {
@@ -55,6 +57,7 @@ void SystemSingletonInternal::PushDestroyCallbacks()
void System::DirectDisplayInitialize()
{
+#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
// Set up display code for Windows
Win32::DisplayShim::GetInstance();
@@ -72,6 +75,7 @@ void System::DirectDisplayInitialize()
DisplayShimInitialized = Win32::DisplayShim::GetInstance().Initialize(anyExtendedRifts);
#endif
+#endif /* !defined(HEADLESS_APP) */
}
bool System::DirectDisplayEnabled()
@@ -100,9 +104,11 @@ void System::Destroy()
{
if (Allocator::GetInstance())
{
+#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
Win32::DisplayShim::GetInstance().Shutdown();
#endif
+#endif /* !defined(HEADLESS_APP) */
// Invoke all of the post-finish callbacks (normal case)
for (SystemSingletonInternal *listener = SystemShutdownListenerStack; listener; listener = listener->NextSingleton)
diff --git a/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp b/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp
index 4146dda..29ef845 100644
--- a/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp
+++ b/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp
@@ -1103,7 +1103,7 @@ void Thread::SetThreadName(const char* name, ThreadId threadId)
void Thread::SetCurrentThreadName( const char* name )
{
- SetThreadName(name, (ThreadId)::GetCurrentThreadId());
+ SetThreadName(name, (ThreadId)(intptr_t)::GetCurrentThreadId()); // should be: typedef intptr_t ThreadId;
}
diff --git a/LibOVR/Src/Kernel/OVR_Types.h b/LibOVR/Src/Kernel/OVR_Types.h
index d42d131..31bdd62 100644
--- a/LibOVR/Src/Kernel/OVR_Types.h
+++ b/LibOVR/Src/Kernel/OVR_Types.h
@@ -587,7 +587,7 @@ struct OVR_GUID
#include <stdlib.h>
#define OVR_ASSERT_M(p, message) do { if (!(p)) { OVR_DEBUG_BREAK; exit(0); } } while(0)
#define OVR_ASSERT(p) do { if (!(p)) { OVR_DEBUG_BREAK; exit(0); } } while(0)
- #else
+ #elif !defined(HEADLESS_APP)
// void OVR_ASSERT_M(bool expression, const char message);
// Note: The expresion below is expanded into all usage of this assertion macro.
// We should try to minimize the size of the expanded code to the extent possible.
@@ -611,6 +611,30 @@ struct OVR_GUID
// void OVR_ASSERT(bool expression);
#define OVR_ASSERT(p) OVR_ASSERT_M((p), (#p))
+ #else
+ // void OVR_ASSERT_M(bool expression, const char message);
+ // Note: The expresion below is expanded into all usage of this assertion macro.
+ // We should try to minimize the size of the expanded code to the extent possible.
+ #define OVR_ASSERT_M(p, message) do \
+ { \
+ if (!(p)) \
+ { \
+ intptr_t ovrAssertUserParam; \
+ OVRAssertionHandler ovrAssertUserHandler = OVR::GetAssertionHandler(&ovrAssertUserParam); \
+ \
+ if(ovrAssertUserHandler) \
+ { \
+ ovrAssertUserHandler(ovrAssertUserParam, "Assertion failure", message); \
+ } \
+ else \
+ { \
+ OVR_DEBUG_BREAK; \
+ } \
+ } \
+ } while(0)
+
+ // void OVR_ASSERT(bool expression);
+ #define OVR_ASSERT(p) OVR_ASSERT_M((p), (#p))
#endif
// Acts the same as OVR_ASSERT in debug builds. Acts the same as OVR_UNUSED in release builds.
diff --git a/LibOVR/Src/OVR_CAPI.cpp b/LibOVR/Src/OVR_CAPI.cpp
index 8e6c676..6d8d711 100644
--- a/LibOVR/Src/OVR_CAPI.cpp
+++ b/LibOVR/Src/OVR_CAPI.cpp
@@ -40,9 +40,11 @@ limitations under the License.
#include "Service/Service_NetServer.h"
#endif
+#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
#include "Displays/OVR_Win32_ShimFunctions.h"
#endif
+#endif /* !defined(HEADLESS_APP) */
using namespace OVR;
@@ -252,11 +254,13 @@ static ovrBool CAPI_ovrInitializeCalled = 0;
static OVR::Service::NetClient* CAPI_pNetClient = 0;
+#if !defined(HEADLESS_APP)
OVR_EXPORT ovrBool ovr_InitializeRenderingShim()
{
OVR::System::DirectDisplayInitialize();
return OVR::System::DirectDisplayEnabled();
}
+#endif /* !defined(HEADLESS_APP) */
OVR_EXPORT ovrBool ovr_Initialize()
{
@@ -383,6 +387,7 @@ OVR_EXPORT ovrHmd ovrHmd_Create(int index)
return hmds->pHmdDesc;
}
+#if !defined(HEADLESS_APP)
OVR_EXPORT ovrBool ovrHmd_AttachToWindow( ovrHmd hmd, void* window,
const ovrRecti* destMirrorRect,
@@ -411,6 +416,8 @@ OVR_EXPORT ovrBool ovrHmd_AttachToWindow( ovrHmd hmd, void* window,
return true;
}
+#endif /* !defined(HEADLESS_APP) */
+
OVR_EXPORT ovrHmd ovrHmd_CreateDebug(ovrHmdType type)
{
if (!CAPI_ovrInitializeCalled)
@@ -434,6 +441,7 @@ OVR_EXPORT void ovrHmd_Destroy(ovrHmd hmddesc)
ThreadChecker::Scope checkScope(&hmds->RenderAPIThreadChecker, "ovrHmd_Destroy");
}
+#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
if (hmds->pWindow)
{
@@ -443,6 +451,7 @@ OVR_EXPORT void ovrHmd_Destroy(ovrHmd hmddesc)
Win32::DisplayShim::GetInstance().hWindow = (HWND)0;
}
#endif
+#endif /* !defined(HEADLESS_APP) */
delete (HMDState*)hmddesc->Handle;
}
@@ -552,10 +561,12 @@ OVR_EXPORT ovrTrackingState ovrHmd_GetTrackingState(ovrHmd hmddesc, double absTi
else
memset(&result, 0, sizeof(result));
+#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
// Set up display code for Windows
Win32::DisplayShim::GetInstance().Active = (result.StatusFlags & ovrStatus_HmdConnected) != 0;
#endif
+#endif /* !defined(HEADLESS_APP) */
return result;
}
@@ -651,6 +662,7 @@ OVR_EXPORT 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.
{
@@ -663,6 +675,7 @@ OVR_EXPORT void ovrHmd_EndFrame(ovrHmd hmddesc,
hmds->pHSWDisplay->Render(ovrEye_Right, &eyeTexture[ovrEye_Right]);
}
}
+#endif /* !defined(HEADLESS_APP) */
hmds->pRenderer->EndFrame(true);
hmds->pRenderer->RestoreGraphicsState();
@@ -683,6 +696,7 @@ OVR_EXPORT void ovrHmd_EndFrame(ovrHmd hmddesc,
}
+#if !defined(HEADLESS_APP)
// Not exposed as part of public API
OVR_EXPORT void ovrHmd_RegisterPostDistortionCallback(ovrHmd hmddesc, PostDistortionCallback callback)
{
@@ -694,6 +708,7 @@ OVR_EXPORT void ovrHmd_RegisterPostDistortionCallback(ovrHmd hmddesc, PostDistor
hmds->pRenderer->RegisterPostDistortionCallback(callback);
}
}
+#endif /* !defined(HEADLESS_APP) */
@@ -1042,6 +1057,8 @@ OVR_EXPORT double ovrHmd_GetMeasuredLatencyTest2(ovrHmd hmddesc)
// ***** Health and Safety Warning Display interface
//
+#if !defined(HEADLESS_APP)
+
OVR_EXPORT void ovrHmd_GetHSWDisplayState(ovrHmd hmd, ovrHSWDisplayState *hswDisplayState)
{
OVR::CAPI::HMDState* pHMDState = (OVR::CAPI::HMDState*)hmd->Handle;
@@ -1070,6 +1087,7 @@ OVR_EXPORT ovrBool ovrHmd_DismissHSWDisplay(ovrHmd hmd)
return false;
}
+#endif /* !defined(HEADLESS_APP) */
// -----------------------------------------------------------------------------------
// ***** Property Access
diff --git a/LibOVR/Src/OVR_CAPI.h b/LibOVR/Src/OVR_CAPI.h
index ca41d3f..a2b5e79 100644
--- a/LibOVR/Src/OVR_CAPI.h
+++ b/LibOVR/Src/OVR_CAPI.h
@@ -425,6 +425,7 @@ typedef struct ovrEyeRenderDesc_
/// to return portable types such as ovrTexture and ovrRenderAPIConfig.
typedef enum
{
+#if !defined(HEADLESS_APP)
ovrRenderAPI_None,
ovrRenderAPI_OpenGL,
ovrRenderAPI_Android_GLES, // May include extra native window pointers, etc.
@@ -432,6 +433,10 @@ typedef enum
ovrRenderAPI_D3D10,
ovrRenderAPI_D3D11,
ovrRenderAPI_Count
+#else /* !defined(HEADLESS_APP) */
+ ovrRenderAPI_None,
+ ovrRenderAPI_Count
+#endif /* !defined(HEADLESS_APP) */
} ovrRenderAPIType;
/// Platform-independent part of rendering API-configuration data.
@@ -502,6 +507,7 @@ typedef struct OVR_ALIGNAS(8) ovrTexture_
extern "C" {
#endif
+#if !defined(HEADLESS_APP)
// ovr_InitializeRenderingShim initializes the rendering shim appart from everything
// else in LibOVR. This may be helpful if the application prefers to avoid
// creating any OVR resources (allocations, service connections, etc) at this point.
@@ -512,6 +518,7 @@ extern "C" {
// Direct3D or OpenGL initilization is done by applictaion (creation of devices, etc).
// ovr_Initialize() must still be called after to use the rest of LibOVR APIs.
OVR_EXPORT ovrBool ovr_InitializeRenderingShim();
+#endif /* !defined(HEADLESS_APP) */
// Library init/shutdown, must be called around all other OVR code.
// No other functions calls besides ovr_InitializeRenderingShim are allowed
@@ -544,6 +551,7 @@ OVR_EXPORT ovrHmd ovrHmd_CreateDebug(ovrHmdType type);
/// Pass null hmd to get global errors (during create etc).
OVR_EXPORT const char* ovrHmd_GetLastError(ovrHmd hmd);
+#if !defined(HEADLESS_APP)
/// Platform specific function to specify the application window whose output will be
/// displayed on the HMD. Only used if the ovrHmdCap_ExtendDesktop flag is false.
/// Windows: SwapChain associated with this window will be displayed on the HMD.
@@ -554,6 +562,7 @@ OVR_EXPORT const char* ovrHmd_GetLastError(ovrHmd hmd);
OVR_EXPORT ovrBool ovrHmd_AttachToWindow(ovrHmd hmd, void* window,
const ovrRecti* destMirrorRect,
const ovrRecti* sourceRenderTargetRect);
+#endif /* !defined(HEADLESS_APP) */
/// Returns capability bits that are enabled at this time as described by ovrHmdCaps.
/// Note that this value is different font ovrHmdDesc::HmdCaps, which describes what
@@ -836,6 +845,8 @@ OVR_EXPORT ovrBool ovrHmd_GetLatencyTest2DrawColor(ovrHmd hmddesc, unsigned
// ***** Health and Safety Warning Display interface
//
+#if !defined(HEADLESS_APP)
+
/// Used by ovrhmd_GetHSWDisplayState to report the current display state.
typedef struct ovrHSWDisplayState_
{
@@ -886,6 +897,8 @@ OVR_EXPORT void ovrHmd_GetHSWDisplayState(ovrHmd hmd, ovrHSWDisplayState *hasWar
/// }
OVR_EXPORT ovrBool ovrHmd_DismissHSWDisplay(ovrHmd hmd);
+#endif /* !defined(HEADLESS_APP) */
+
/// Get boolean property. Returns first element if property is a boolean array.
/// Returns defaultValue if property doesn't exist.
OVR_EXPORT ovrBool ovrHmd_GetBool(ovrHmd hmd, const char* propertyName, ovrBool defaultVal);