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

@@ -579,6 +579,8 @@ bool win32_vr_start()
return false;
}
if (hmd_renderer.joinable())
hmd_renderer.join();
hmd_renderer = std::thread([&] {
if (!vive)
return;
@@ -620,9 +622,9 @@ bool win32_vr_start()
if (vr_running && vive->m_active)
{
async_lock();
vive->Draw();
async_unlock();
App::I->render_task([] {
vive->Draw();
});
}
const int framerate = (1.f / target_tick_rate) * 1000;
@@ -633,11 +635,7 @@ bool win32_vr_start()
App::I->vr_active = false;
App::I->has_vr = false;
vr_running = false;
if (async_lock_try())
{
vive->Terminate();
async_unlock();
}
vive->Terminate();
LOG("hmd renderer terminated");
});
return true;