27 #ifndef OVR_CAPI_HMDState_h
28 #define OVR_CAPI_HMDState_h
30 #include "../Kernel/OVR_Math.h"
31 #include "../Kernel/OVR_List.h"
32 #include "../Kernel/OVR_Log.h"
33 #include "../OVR_CAPI.h"
34 #include "../OVR_SensorFusion.h"
35 #include "../Util/Util_LatencyTest.h"
36 #include "../Util/Util_LatencyTest2.h"
43 #ifdef OVR_CAPI_VISIONSUPPORT
44 #define OVR_CAPI_VISION_CODE(c) c
45 #include "../Vision/Vision_PoseTracker.h"
47 #define OVR_CAPI_VISION_CODE(c)
53 namespace OVR {
namespace CAPI {
55 using namespace OVR::Util::Render;
67 #ifndef OVR_BUILD_DEBUG
82 #else // OVR_BUILD_DEBUG
86 void Begin(
const char* functionName)
90 pFunctionName = functionName;
97 (
"%s (threadId=%p) called at the same times as %s (threadId=%p)\n",
110 Scope(ThreadChecker* threadChecker,
const char *functionName) : pChecker(threadChecker)
111 { pChecker->Begin(functionName); }
115 ThreadChecker* pChecker;
120 const char * pFunctionName;
123 #endif // OVR_BUILD_DEBUG
143 bool StartSensor(
unsigned supportedCaps,
unsigned requiredCaps);
152 void SetEnabledHmdCaps(
unsigned caps);
155 bool ProcessLatencyTest(
unsigned char rgbColorOut[3]);
156 void ProcessLatencyTest2(
unsigned char rgbColorOut[3],
double startTime);
164 unsigned distortionCaps);
172 const char* p = pLastError;
183 AddLatencyTestCount++;
184 AddLatencyTestDisplayCount++;
188 bool checkCreateSensor();
190 void applyProfileToSensorFusion();
199 (
"%s called outside ovrHmd_BeginFrame.", functionName));
201 (
"%s called on a different thread then ovrHmd_BeginFrame.", functionName));
208 (
"%s called without ovrHmd_ConfigureRendering.", functionName));
215 (
"%s called outside ovrHmd_BeginFrameTiming.", functionName));
221 void updateLowPersistenceMode(
bool lowPersistence)
const;
222 void updateLatencyTestForHmd(
bool latencyTesting);
224 void updateDK2FeaturesTiedToSensor(
bool sensorCreatedJustNow);
227 float getFloatValue(
const char* propertyName,
float defaultVal);
228 bool setFloatValue(
const char* propertyName,
float value);
229 unsigned getFloatArray(
const char* propertyName,
float values[],
unsigned arraySize);
230 bool setFloatArray(
const char* propertyName,
float values[],
unsigned arraySize);
231 const char* getString(
const char* propertyName,
const char* defaultVal);
292 Vision::PoseTracker* pPoseTracker;
301 unsigned char LatencyTestDrawColor[3];
309 unsigned char LatencyTest2DrawColor[3];
324 char LastGetStringValue[256];
338 bool EyeRenderActive[2];
345 #endif // OVR_CAPI_HMDState_h
virtual bool GetDeviceInfo(DeviceInfo *info) const
double LastFrameTimeSeconds
volatile bool SensorStarted
#define OVR_ASSERT_LOG(c, args)
ThreadChecker RenderAPIThreadChecker
HMDInfoWrapper(ovrHmdType hmdType)
AtomicInt< int > AddLatencyTestCount
const OVR::HMDInfo & HMDInfo
HMDRenderState RenderState
void checkRenderingConfigured(const char *functionName)
HMDInfoWrapper(HMDDevice *device)
enum _deviceType deviceType
void checkBeginFrameTimingScope(const char *functionName)
ThreadId BeginFrameThreadId
Scope(ThreadChecker *, const char *)
const HMDInfoWrapper HMDInfoW
#define OVR_CAPI_VISION_CODE(c)
double LastGetFrameTimeSeconds
void Begin(const char *functionName)
AtomicInt< int > AddLatencyTestDisplayCount
Ptr< LatencyTestDevice > pLatencyTesterDisplay
HMDInfo CreateDebugHMDInfo(HmdTypeEnum hmdType)
unsigned HmdCapsAppliedToSensor
Ptr< SensorDevice > pSensor
Ptr< DistortionRenderer > pRenderer
void checkBeginFrameScope(const char *functionName)
Util::LatencyTest LatencyUtil
Util::LatencyTest2 LatencyUtil2
AtomicInt< int > AddSensorCount
FrameTimeManager TimeManager
volatile bool SensorCreated
bool BeginFrameTimingCalled
void NotifyAddDevice(DeviceType deviceType)
ThreadId GetCurrentThreadId()
const char * GetLastError()