本文整理汇总了C++中HMDState::checkBeginFrameScope方法的典型用法代码示例。如果您正苦于以下问题:C++ HMDState::checkBeginFrameScope方法的具体用法?C++ HMDState::checkBeginFrameScope怎么用?C++ HMDState::checkBeginFrameScope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HMDState
的用法示例。
在下文中一共展示了HMDState::checkBeginFrameScope方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ovrHmd_EndFrame
// Renders textures to frame buffer
OVR_EXPORT void ovrHmd_EndFrame(ovrHmd hmddesc,
const ovrPosef renderPose[2],
const ovrTexture eyeTexture[2])
{
HMDState* hmds = (HMDState*)hmddesc->Handle;
if (!hmds) return;
// Instrument when the EndFrame() call started
hmds->LagStats.InstrumentEndFrameStart(ovr_GetTimeInSeconds());
hmds->SubmitEyeTextures(renderPose, eyeTexture);
// Debug state checks: Must be in BeginFrame, on the same thread.
hmds->checkBeginFrameScope("ovrHmd_EndFrame");
ThreadChecker::Scope checkScope(&hmds->RenderAPIThreadChecker, "ovrHmd_EndFrame");
hmds->pRenderer->SetLatencyTestColor(hmds->LatencyTestActive ? hmds->LatencyTestDrawColor : NULL);
ovrHmd_GetLatencyTest2DrawColor(hmddesc, NULL); // We don't actually need to draw color, so send NULL
if (hmds->pRenderer)
{
hmds->pRenderer->SaveGraphicsState();
// 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.
{
ovrHSWDisplayState hswDisplayState;
hmds->pHSWDisplay->TickState(&hswDisplayState, true); // This may internally call HASWarning::Display.
if (hswDisplayState.Displayed)
{
hmds->pHSWDisplay->Render(ovrEye_Left, &eyeTexture[ovrEye_Left]);
hmds->pHSWDisplay->Render(ovrEye_Right, &eyeTexture[ovrEye_Right]);
}
}
hmds->pRenderer->EndFrame(true);
hmds->pRenderer->RestoreGraphicsState();
}
// Call after present
ovrHmd_EndFrameTiming(hmddesc);
// Instrument latency tester
hmds->LagStats.InstrumentLatencyTimings(hmds->TimeManager);
// Instrument when the EndFrame() call ended
hmds->LagStats.InstrumentEndFrameEnd(ovr_GetTimeInSeconds());
// Out of BeginFrame
hmds->BeginFrameThreadId = 0;
hmds->BeginFrameCalled = false;
}
示例2: ovrHmd_EndFrame
// Renders textures to frame buffer
OVR_EXPORT void ovrHmd_EndFrame(ovrHmd hmd)
{
HMDState* hmds = (HMDState*)hmd;
if (!hmds) return;
// Debug state checks: Must be in BeginFrame, on the same thread.
hmds->checkBeginFrameScope("ovrHmd_EndFrame");
ThreadChecker::Scope checkScope(&hmds->RenderAPIThreadChecker, "ovrHmd_EndFrame");
// TBD: Move directly into renderer
bool dk2LatencyTest = (hmds->HMDInfo.HmdType == HmdType_DK2) &&
(hmds->EnabledHmdCaps & ovrHmdCap_LatencyTest);
if (dk2LatencyTest)
{
hmds->LatencyTest2DrawColor[0] = hmds->TimeManager.GetFrameLatencyTestDrawColor();
hmds->LatencyTest2DrawColor[1] = hmds->LatencyTest2DrawColor[0];
hmds->LatencyTest2DrawColor[2] = hmds->LatencyTest2DrawColor[0];
}
if (hmds->pRenderer)
{
hmds->pRenderer->SaveGraphicsState();
hmds->pRenderer->EndFrame(true,
hmds->LatencyTestActive ? hmds->LatencyTestDrawColor : NULL,
// MA: Use this color since we are running DK2 test all the time.
dk2LatencyTest ? hmds->LatencyTest2DrawColor : 0
//hmds->LatencyTest2Active ? hmds->LatencyTest2DrawColor : NULL
);
hmds->pRenderer->RestoreGraphicsState();
}
// Call after present
ovrHmd_EndFrameTiming(hmd);
if (dk2LatencyTest)
{
hmds->TimeManager.UpdateFrameLatencyTrackingAfterEndFrame(
hmds->LatencyTest2DrawColor[0], hmds->LatencyUtil2.GetLocklessState());
}
// Out of BeginFrame
hmds->BeginFrameThreadId = 0;
hmds->BeginFrameCalled = false;
}
示例3: ovrHmd_EndFrame
// Renders textures to frame buffer
OVR_EXPORT void ovrHmd_EndFrame(ovrHmd hmddesc,
const ovrPosef renderPose[2],
const ovrTexture eyeTexture[2])
{
HMDState* hmds = (HMDState*)hmddesc->Handle;
if (!hmds) return;
hmds->SubmitEyeTextures(renderPose, eyeTexture);
// Debug state checks: Must be in BeginFrame, on the same thread.
hmds->checkBeginFrameScope("ovrHmd_EndFrame");
ThreadChecker::Scope checkScope(&hmds->RenderAPIThreadChecker, "ovrHmd_EndFrame");
hmds->pRenderer->SetLatencyTestColor(hmds->LatencyTestActive ? hmds->LatencyTestDrawColor : NULL);
// TBD: Move directly into renderer
bool dk2LatencyTest = (hmds->EnabledHmdCaps & ovrHmdCap_DynamicPrediction) != 0;
if (dk2LatencyTest)
{
hmds->TimeManager.GetFrameLatencyTestDrawColor(hmds->LatencyTest2DrawColor);
hmds->pRenderer->SetLatencyTest2Color(hmds->LatencyTest2DrawColor);
}
else
{
hmds->pRenderer->SetLatencyTest2Color(NULL);
}
if (hmds->pRenderer)
{
hmds->pRenderer->SaveGraphicsState();
// 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.
{
ovrHSWDisplayState hswDisplayState;
hmds->pHSWDisplay->TickState(&hswDisplayState); // This may internally call HASWarning::Display.
if (hswDisplayState.Displayed)
{
hmds->pHSWDisplay->Render(ovrEye_Left, &eyeTexture[ovrEye_Left]);
hmds->pHSWDisplay->Render(ovrEye_Right, &eyeTexture[ovrEye_Right]);
}
}
hmds->pRenderer->EndFrame(true);
hmds->pRenderer->RestoreGraphicsState();
}
// Call after present
ovrHmd_EndFrameTiming(hmddesc);
if (dk2LatencyTest)
{
Util::FrameTimeRecordSet recordset;
hmds->TheLatencyTestStateReader.GetRecordSet(recordset);
hmds->TimeManager.UpdateFrameLatencyTrackingAfterEndFrame( hmds->LatencyTest2DrawColor,
recordset);
}
// Out of BeginFrame
hmds->BeginFrameThreadId = 0;
hmds->BeginFrameCalled = false;
}