implement tasks for update windows vr

This commit is contained in:
2019-07-27 15:52:15 +02:00
parent 5fc27ebb14
commit ae5da7139c
3 changed files with 37 additions and 33 deletions

View File

@@ -24,13 +24,15 @@ bool Vive::Initialize()
m_settings = vr::VRSettings();
m_hmd->GetRecommendedRenderTargetSize(&m_eye_width, &m_eye_height);
for (int eye = 0; eye < 2; ++eye)
{
m_eyes[eye].create(m_eye_width, m_eye_height);
m_eyes[eye].bindFramebuffer();
m_eyes[eye].clear({ 1, 0, 0, 1 });
m_eyes[eye].unbindFramebuffer();
}
App::I->render_task([&]{
for (int eye = 0; eye < 2; ++eye)
{
m_eyes[eye].create(m_eye_width, m_eye_height);
m_eyes[eye].bindFramebuffer();
m_eyes[eye].clear({ 1, 0, 0, 1 });
m_eyes[eye].unbindFramebuffer();
}
});
vr::CVRSettingHelper s(m_settings);
float timeout = s.GetFloat(vr::k_pch_Power_Section, vr::k_pch_Power_TurnOffScreensTimeout_Float);