Skip to content

Commit

Permalink
Calculate sleep counter
Browse files Browse the repository at this point in the history
  • Loading branch information
oneup03 committed Jul 13, 2024
1 parent 9ee1529 commit 414549e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vrto3d/src/hmd_device_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ float StereoDisplayComponent::GetConvergence()
//-----------------------------------------------------------------------------
void StereoDisplayComponent::CheckUserSettings(uint32_t device_index)
{
static int sleep_count = (int)(floor(1600.0 / (1000.0 / config_.display_frequency)));
XINPUT_STATE state;
ZeroMemory(&state, sizeof(XINPUT_STATE));
// Get the state of the first controller (index 0)
Expand Down Expand Up @@ -657,7 +658,7 @@ void StereoDisplayComponent::CheckUserSettings(uint32_t device_index)
}
else if (config_.user_key_type[i] == TOGGLE && config_.sleep_count[i] < 1)
{
config_.sleep_count[i] = 100;
config_.sleep_count[i] = sleep_count;
if (GetDepth() == config_.user_depth[i] && GetConvergence() == config_.user_convergence[i])
{
// If the current state matches the user settings, revert to the previous state
Expand Down

0 comments on commit 414549e

Please sign in to comment.